/*
 * Общие элементы сайта digitallegends.ru для статичных страниц (/ai-avatars/, /mocap-studio/):
 * шапка, бургер-меню и подвал как на главной.
 * Один и тот же файл лежит в ветках ai-avatars и mocap (assets/dl-site/) – правьте оба.
 */

@font-face {
  font-family: "DL Onest";
  src: url("fonts/Onest-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DL Onest";
  src: url("fonts/Onest-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DL Druk";
  src: url("fonts/Druk-Wide-Medium-Web.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Логотип в шапке (как в шапке /ai-avatars/) ---------- */

.dl-logo {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  min-width: 0;
  line-height: 0;
}

.dl-logo img {
  display: block;
  width: auto;
  height: 32px;
  max-width: min(178px, 46vw);
}

@media (max-width: 640px) {
  .dl-logo img {
    height: 26px;
  }
}

/* ---------- Кнопка бургера (как на главной) ---------- */

.dl-burger {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.dl-burger i {
  position: absolute;
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform-origin: 0 0;
  transition:
    top 280ms cubic-bezier(0.22, 1, 0.36, 1),
    left 280ms cubic-bezier(0.22, 1, 0.36, 1),
    width 280ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Те же координаты линий, что у бургера главной: линии прижаты к правому краю кнопки. */
.dl-burger i:nth-child(1) { top: 10.75px; left: 17.556px; width: 26px; }
.dl-burger i:nth-child(2) { top: 18.75px; left: 29px; width: 14.8005px; }
.dl-burger i:nth-child(3) { top: 26.75px; left: 17.556px; width: 26px; }

.dl-burger.is-open i:nth-child(1) { top: 22.5785px; left: 15px; transform: rotate(-45deg); }
.dl-burger.is-open i:nth-child(2) { top: 24.2757px; left: 24.6165px; transform: rotate(-45deg); }
.dl-burger.is-open i:nth-child(3) { top: 33.8922px; left: 26.3137px; transform: rotate(-45deg); }

.dl-burger:focus:not(:focus-visible) {
  outline: none;
}

.dl-burger:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .dl-burger:hover {
    opacity: 0.8;
  }
}

/* ---------- Меню: панель слева, как на главной ---------- */

/* На /mocap-studio/ прокручивается body, на /ai-avatars/ – html: блокируем оба. */
html.dl-menu-open,
html.dl-menu-open body {
  overflow: hidden !important;
}

/* Шапка с кнопкой-крестиком остаётся над панелью. */
html.dl-menu-open .header {
  z-index: 10040 !important;
}

.dl-menu {
  position: fixed;
  inset: 0;
  z-index: 10030;
  font-family: "DL Onest", "Onest", system-ui, sans-serif;
}

.dl-menu[hidden] {
  display: none !important;
}

.dl-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
}

.dl-menu__panel {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  width: clamp(320px, 33.333vw, 640px);
  height: 100dvh;
  padding: calc(var(--dl-header-h, 72px) + 52px) 40px 42px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.92);
  color: #ffffff;
  animation: dl-menu-in 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dl-menu.is-closing .dl-menu__panel {
  animation: dl-menu-out 300ms cubic-bezier(0.64, 0, 0.78, 0) both;
}

.dl-menu__groups {
  align-self: center;
  display: grid;
  gap: 28px;
  min-width: 0;
}

.dl-menu__nav {
  display: grid;
  gap: 16px;
  max-width: 320px;
}

.dl-menu__nav a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 5px;
  color: rgba(243, 240, 247, 0.62);
  font-size: 15px;
  font-weight: 400;
  line-height: 20px;
  text-decoration: none;
  text-transform: uppercase;
  outline: none;
  transition:
    color 300ms cubic-bezier(0.22, 1, 0.36, 1),
    text-shadow 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dl-menu__nav a span {
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dl-menu__nav a:focus-visible {
  color: #ffffff;
  outline: 1px solid rgba(255, 255, 255, 0.72);
  outline-offset: 4px;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.46);
}

@media (hover: hover) and (pointer: fine) {
  .dl-menu__nav:hover a {
    color: rgba(243, 240, 247, 0.46);
  }

  .dl-menu__nav a:hover {
    color: #ffffff;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.46);
  }

  .dl-menu__nav a:hover span {
    transform: translateX(3px);
  }
}

.dl-menu__socials {
  justify-content: space-between;
  width: 100%;
}

/* «Обсудить проект» перед соцсетями: светлая кнопка, как на главной. */
.dl-menu__cta,
.dl-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 8px;
  min-width: 156px;
  height: 44px;
  margin-bottom: 28px;
  padding: 0 24px;
  border-radius: 999px;
  background: #f3f0f7;
  color: #090a0b;
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.24s ease, transform 0.24s ease;
}

.dl-menu__cta svg,
.dl-header-cta svg {
  flex: 0 0 10px;
}

.dl-menu__cta:focus-visible,
.dl-header-cta:focus-visible {
  outline: 2px solid #f3f0f7;
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .dl-menu__cta:hover,
  .dl-header-cta:hover {
    background: #ffffff;
    transform: translateY(-1px);
  }
}

/* Десктоп: в шапке кнопка «Обсудить проект» вместо бургера (ссылки на продукты видны).
   Когда ссылки в шапке скрыты (до 1000px), остается бургер, как на мобильном. */
.dl-header-cta {
  justify-self: auto;
  margin-bottom: 0;
}

@media (min-width: 1001px) {
  .header .dl-burger {
    display: none;
  }
}

@media (max-width: 1000px) {
  .dl-header-cta {
    display: none;
  }
}

@keyframes dl-menu-in {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes dl-menu-out {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@media (max-width: 760px) {
  .dl-menu__backdrop {
    background: transparent;
  }

  .dl-menu__panel {
    width: calc(61.282vw + 20px);
    min-width: 260px;
    padding: max(calc(var(--dl-header-h, 72px) + 40px), calc(env(safe-area-inset-top) + 94px)) 26px max(28px, env(safe-area-inset-bottom)) 30px;
  }

  .dl-menu__nav {
    gap: 0;
  }

  .dl-menu__nav a {
    grid-template-columns: 13px minmax(0, 1fr);
    gap: 3px;
    align-items: center;
    min-height: 44px;
    padding-block: 6px;
    color: #ffffff;
    font-size: 12px;
    line-height: 16px;
  }

  .dl-socials.dl-menu__socials {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    gap: 16px;
    justify-content: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dl-menu__panel,
  .dl-menu.is-closing .dl-menu__panel,
  .dl-burger i {
    animation: none;
    transition: none;
  }
}

/* ---------- Соцсети: белые круги, как на главной ---------- */

.dl-socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dl-socials a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  text-decoration: none;
  transition: transform 180ms ease;
}

.dl-socials a span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f0f7;
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.dl-socials img {
  display: block;
  width: 62%;
  height: 62%;
  object-fit: contain;
  filter: brightness(0);
}

.dl-socials a:focus-visible {
  outline: 1px solid rgba(243, 240, 247, 0.84);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .dl-socials a:hover {
    transform: translateY(-2px);
  }

  .dl-socials a:hover span {
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), 0 0 16px rgba(243, 240, 247, 0.16);
    transform: scale(1.06);
  }
}

/* ---------- Подвал как на главной ---------- */

.dl-footer {
  padding: 74px 0 36px;
  background: transparent;
  color: #f3f0f7;
  font-family: "DL Onest", "Onest", system-ui, sans-serif;
}

.dl-footer__line {
  height: 1px;
  margin: 0 0 20px;
  background: rgba(255, 255, 255, 0.12);
}

.dl-footer__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 40px;
}

.dl-footer__contacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.dl-footer__contact span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}

.dl-footer__contact a {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
}

.dl-footer__contact a:hover {
  color: #ffffff;
}

.dl-footer__follow,
.dl-footer__slogan {
  display: none;
}

.dl-footer__legal {
  display: grid;
  gap: 12px;
  color: #99a1af;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.dl-footer__legal p {
  margin: 0;
}

.dl-footer__legal a {
  width: fit-content;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  text-transform: uppercase;
}

.dl-footer__legal a:hover {
  color: #f3f0f7;
}

@media (max-width: 760px) {
  .dl-footer {
    margin: 0;
    padding: 27px 20px calc(32px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
    background: #060607;
  }

  /* Отступы задает сам подвал (как на главной), а не .container страницы. */
  .dl-footer .dl-footer__inner {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .dl-footer__line {
    display: none;
  }

  .dl-footer__row {
    display: block;
    margin: 0;
  }

  .dl-footer__contacts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dl-footer__contact {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    margin-bottom: 18px;
  }

  .dl-footer__contact span {
    margin: 0;
    color: #777980;
    font-weight: 500;
    line-height: 14px;
  }

  .dl-footer__contact a {
    color: #f3f0f7;
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
  }

  .dl-footer__follow {
    display: block;
    margin: 25px 0 0;
    padding: 30px 0 9px;
    border-top: 1px solid #35363a;
    color: #f3f0f7;
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
  }

  .dl-footer__socials {
    justify-content: space-between;
    height: 72px;
    padding: 0 8px;
    border-bottom: 1px solid #35363a;
  }

  .dl-footer__slogan {
    position: relative;
    display: block;
    height: 195px;
    border-bottom: 1px solid #35363a;
    font-family: "DL Druk", "Druk Wide", system-ui, sans-serif;
    font-weight: 500;
    text-transform: uppercase;
  }

  .dl-footer__slogan span,
  .dl-footer__slogan strong,
  .dl-footer__slogan em {
    position: absolute;
    font-style: normal;
    font-weight: 500;
  }

  .dl-footer__slogan span {
    top: 43px;
    left: 0;
    color: #f3f0f7;
    font-size: 38px;
    line-height: 39px;
    letter-spacing: -0.76px;
  }

  .dl-footer__slogan strong {
    top: 85px;
    left: 0;
    display: inline-block;
    background: linear-gradient(162deg, #6f7cff 14%, #c75cff 46%, #f25ebf 66%, #ffb25e 86%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 38px;
    line-height: 39px;
    letter-spacing: -0.76px;
  }

  .dl-footer__slogan em {
    top: 138px;
    right: 7px;
    color: #d9d9d9;
    font-size: 20px;
    line-height: 21px;
    letter-spacing: -0.4px;
  }

  .dl-footer__legal {
    gap: 0;
    padding-top: 20px;
    font-size: 9px;
    line-height: 13.8px;
  }

  .dl-footer__legal p,
  .dl-footer__legal a {
    margin: 0 0 20px;
  }

  .dl-footer__legal a:last-child {
    margin-bottom: 0;
  }
}

/* ---------- Шапка как на главной ----------
 * Размеры и шрифт как у закрепленной шапки главной после начала прокрутки (и как на /faceswap/):
 * высота 72px, лого 118px и «Обсудить проект» (или бургер) в 48px от краев, продукты по центру окна, Onest 14px.
 * 761–1000px: продукты между лого и бургером, без Высоцкий.Высота. До 760px: лого 96px и бургер в 20px от краев.
 * Селекторы с [class] и !important: в styles.css обеих страниц много поздних правил шапки с !important. */

html body header.header[class] {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  background: rgba(5, 6, 7, 0.72) !important;
  border-bottom: 0 !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  backdrop-filter: blur(18px) !important;
}

html body header.header[class] .header__inner {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  height: 72px !important;
  min-height: 72px !important;
  margin: 0 !important;
  padding: 0 48px !important;
  gap: 16px !important;
}

html body header.header[class] .dl-logo {
  margin: 0 !important;
  padding: 0 !important;
}

html body header.header[class] .dl-logo img {
  width: 118px !important;
  height: auto !important;
  max-width: none !important;
}

html body header.header[class] .nav {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translate(-50%, -50%) !important;
}

html body header.header[class] .nav__link,
html body header.header[class] .nav__link:focus {
  padding: 10px 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(243, 240, 247, 0.72) !important;
  font-family: "DL Onest", "Onest", system-ui, sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 16px !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: color 0.24s ease, background-color 0.24s ease !important;
}

html body header.header[class] .nav__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  html body header.header[class] .nav__link:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
  }
}

html body header.header[class] .header__actions {
  margin: 0 !important;
  gap: 0 !important;
}

html body header.header[class] .dl-header-cta,
.dl-menu__cta {
  box-sizing: border-box;
  min-width: 156px;
  border: 1px solid transparent;
  color: #252323;
  font-family: "DL Onest", "Onest", system-ui, sans-serif;
  letter-spacing: 0.0125em;
}

/* Узкий десктоп и планшет: продукты между лого и бургером, а не по центру окна. */
@media (min-width: 761px) and (max-width: 1099px) {
  html body header.header[class] .nav {
    right: 108px !important;
    left: 190px !important;
    justify-content: center !important;
    gap: 2px !important;
    transform: translateY(-50%) !important;
  }

  html body header.header[class] .nav__link,
  html body header.header[class] .nav__link:focus {
    padding: 10px !important;
    font-size: 13px !important;
  }
}

@media (min-width: 761px) and (max-width: 840px) {
  html body header.header[class] .nav {
    gap: 0 !important;
  }

  html body header.header[class] .nav__link,
  html body header.header[class] .nav__link:focus {
    padding: 10px 6px !important;
  }
}

/* Высоцкий.Высота в шапке только от 1001px: на планшете не помещается между лого и бургером. */
@media (max-width: 1000px) {
  html body header.header[class] .nav__link--wide {
    display: none !important;
  }
}

/* 1001–1279px: продукты между лого и кнопкой «Обсудить проект». */
@media (min-width: 1001px) and (max-width: 1279px) {
  html body header.header[class] .nav {
    right: 252px !important;
    left: 190px !important;
    justify-content: center !important;
    gap: 2px !important;
    transform: translateY(-50%) !important;
  }

  html body header.header[class] .nav__link,
  html body header.header[class] .nav__link:focus {
    padding: 10px !important;
    font-size: 13px !important;
  }
}

@media (min-width: 1001px) and (max-width: 1099px) {
  html body header.header[class] .nav {
    gap: 0 !important;
  }

  html body header.header[class] .nav__link,
  html body header.header[class] .nav__link:focus {
    padding: 10px 8px !important;
    font-size: 12px !important;
  }
}

/* Телефон, как на главной: лого 96px и бургер в 20px от краев, ссылок на продукты нет. */
@media (max-width: 760px) {
  html body header.header[class] .header__inner {
    padding: 0 20px !important;
  }

  html body header.header[class] .dl-logo img {
    width: 96px !important;
  }

  html body header.header[class] .nav {
    display: none !important;
  }
}

/* Высоцкий.Высота: постоянная полупрозрачная подложка в цветах бренда со свечением, как на главной. */
html body header.header[class] .nav__link.nav__link--accent,
html body header.header[class] .nav__link.nav__link--accent:focus {
  background: linear-gradient(
    100deg,
    rgba(111, 124, 255, 0.2) 0%,
    rgba(139, 92, 255, 0.2) 20%,
    rgba(199, 92, 255, 0.2) 40%,
    rgba(240, 95, 199, 0.2) 60%,
    rgba(255, 122, 158, 0.2) 80%,
    rgba(255, 180, 94, 0.2) 100%
  ) !important;
  box-shadow:
    -6px 0 22px -2px rgba(111, 124, 255, 0.55),
    0 0 26px 2px rgba(199, 92, 255, 0.4),
    6px 0 22px -2px rgba(255, 180, 94, 0.5) !important;
  color: #ffffff !important;
  transition: color 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease !important;
}

@media (hover: hover) and (pointer: fine) {
  html body header.header[class] .nav__link.nav__link--accent:hover {
    background: linear-gradient(
      100deg,
      rgba(111, 124, 255, 0.32) 0%,
      rgba(139, 92, 255, 0.32) 20%,
      rgba(199, 92, 255, 0.32) 40%,
      rgba(240, 95, 199, 0.32) 60%,
      rgba(255, 122, 158, 0.32) 80%,
      rgba(255, 180, 94, 0.32) 100%
    ) !important;
    box-shadow:
      -8px 0 28px 0 rgba(111, 124, 255, 0.7),
      0 0 34px 4px rgba(199, 92, 255, 0.5),
      8px 0 28px 0 rgba(255, 180, 94, 0.65) !important;
  }
}

/* Черта между продуктами (с Высоцкий.Высота) и блогом. */
html body header.header[class] .nav__divider {
  flex: 0 0 1px;
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: rgba(243, 240, 247, 0.24);
}
