/* main.html — главный экран по Figma FZMT_Final (Copy) node 44-2698, FZMT_v1_01a */
@import url("fonts-conthrax.css");

.main-page {
  margin: 0;
  min-height: 100vh;
  background: #030e1f;
  font-family: var(--font-family, system-ui, sans-serif);
  overflow-x: hidden;
  position: relative;
}

.main-page__bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  object-position: top center;
  z-index: 0;
  pointer-events: none;
}

.main-page__frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 2160px;
  margin: 0 auto;
  aspect-ratio: 2160 / 3840;

  overflow: hidden;
  isolation: isolate;
}

.main-page__bg-fallback {
  position: absolute;
  inset: 0;
  background: #030e1f url("../images/main/main-bg.png") center / cover no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.main-page__overlay-video {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(85%, 1850px);
  height: auto;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2;
}

.main-page__overlay-video--circles {
  top: 120px;
  width: min(78%, 1700px);
}

.main-page__about-link-wrap {
  position: absolute;
  left: 50%;
  top: 100px;
  transform: translateX(-50%);
  z-index: 6;
  border-radius: 15px;
  border: 3px solid #42c9ff;
  background: rgba(37, 139, 255, 0.02);
  backdrop-filter: blur(3px);
  padding: 5px 4px;
}

.main-page__about-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  min-width: 310px;
  min-height: 78px;
  border-radius: 8px;
  border: 1.5px solid var(--color-border);
  background: rgba(0, 75, 161, 0.40) url(../images/icons/btn_bg.png) no-repeat center center;
  background-size: 100% 90%;
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-family), sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.main-page__about-link-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-left: 33px;
  margin-right: 14px;
}

.main-page__about-link-text {
  display: block;
  flex-grow: 1;
  text-align: center;
  margin-right: 8px;
}

.main-page__about-link:hover {
  background-color: #0077FF;
  background-image: url(../images/icons/btn_bg_active.png);
  border-color: #60D1FF;
}

/* Вертикальные «рейки» по краям (упрощённо от _line в Figma) */
.main-page__rail {
  position: absolute;
  top: 11.43%;
  height: 88.54%;
  width: 42px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
}

.main-page__rail--left {
  left: 20px;
  border-left: 3px dashed rgba(96, 154, 255, 0.85);
  box-shadow: 12px 0 0 -8px rgba(96, 154, 255, 0.25);
}

.main-page__rail--right {
  right: 20px;
  border-right: 3px dashed rgba(96, 154, 255, 0.85);
  box-shadow: -12px 0 0 -8px rgba(96, 154, 255, 0.25);
}

/* Блики сверху/снизу */
.main-page__glow {
  position: absolute;
  left: 0;
  width: 100%;
  height: 16.54%;
  pointer-events: none;
  z-index: 1;
}

.main-page__glow--top {
  top: 8.54%;
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(189, 221, 203, 0.22) 0%, transparent 65%);
}

.main-page__glow--bottom {
  bottom: 0;
  height: 16.54%;
  background: radial-gradient(ellipse 80% 100% at 50% 100%, rgba(189, 221, 203, 0.18) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.main-page__deco {
  position: absolute;
  left: 6.9%;
  top: 6.2%;
  width: 86.7%;
  height: auto;
  max-height: 36.6%;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
  z-index: 1;
  opacity: 0.95;
}

.main-page__logo {
  position: absolute;
  left: 40.23%;
  top: 7.48%;
  width: 20.05%;
  z-index: 4;
}

.main-page__logo img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

/* Карточки-разделы: координаты из Figma (относительно 2160×3840) */
.main-page__cards {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(27.35% + 120px);
  z-index: 5;
  height: 900px;
  overflow: visible;
  pointer-events: auto;
  touch-action: pan-y;
  cursor: grab;
}

/* Перетаскивание: позиции в JS; курсор и без выделения текста */
.main-page__cards.main-page__cards--dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.main-tile {
  /* transform/размеры/позиции — в JS (useMainPageSlider), без CSS-transition на transform */
  position: absolute;
  left: 50%;
  top: 0;
  margin-left: -300px; /* center a 600px-wide tile */
  display: block;
  border-radius: 15px;
  border: 2px solid #42c9ff;
  text-decoration: none;
  color: #fff;
  overflow: visible;
  box-sizing: border-box;
  pointer-events: auto;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  width: 600px;
  height: 900px;
  transform-origin: center  top;
}

.main-tile:hover {
  box-shadow: 0 12px 40px rgba(66, 201, 255, 0.25);
  border-color: #60d1ff;
}

.main-tile:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.main-tile__media {
  position: absolute;
  inset: 0;
  background-image: var(--tile-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.95;
  border-radius: 15px;
  z-index: 0;
}

.main-tile__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 42, 103, 0.95) 0%, rgba(0, 42, 103, 0) 22%),
    linear-gradient(180deg, rgba(0, 42, 103, 0.82) 0%, rgba(0, 42, 103, 0) 58%);
  pointer-events: none;
  border-radius: 15px;
  z-index: 1;
}

.main-tile__panel {
  position: absolute;
  inset: 0;
  background: rgba(0, 21, 51, var(--tile-panel-opacity, 0.6));
  pointer-events: none;
  border-radius: 15px;
  z-index: 2;
}

.main-tile__title {
  position: absolute;
  left: 10%;
  bottom: 12%;
  right: 18%;
  margin: 0;
  font-family: "Conthrax SemiBold", var(--font-family), sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.39;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  z-index: 3;
}

.main-page__cards .main-tile__title {
  font-size: clamp(14px, 1.4vw, 30px);
  bottom: auto;
  top: 6%;
  left: 10%;
  right: 12%;
}

.main-tile--md .main-tile__title {
  font-size: clamp(12px, 1vw, 22px);
  bottom: auto;
  top: 6%;
  left: 10%;
  right: 12%;
}

.main-tile--sm .main-tile__title {
  font-size: clamp(8px, 0.65vw, 12px);
  bottom: auto;
  top: 6%;
  left: 10%;
  right: 12%;
  line-height: 1.35;
}

.main-tile__num {
  position: absolute;
  font-family: "Conthrax SemiBold", var(--font-family), sans-serif;
  font-weight: 600;
  color: #42c9ff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Reflection under the tile (matte glass) */
.main-tile::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 58%;
  background-image: var(--tile-bg);
  background-size: cover;
  background-position: center;
  transform: translateY(6px) scaleY(-1);
  transform-origin: top;
  opacity: 0.3;
  filter: blur(3px) saturate(0.9);
  pointer-events: none;
  z-index: 0;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.12) 45%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.12) 45%, rgba(0, 0, 0, 0) 100%);
}

/* subtle matte-glass veil on reflection */
.main-tile__media::before,
.main-tile__shade::before {
  content: "";
  position: absolute;
  top: 105%; /* Размещаем сразу под блоком */
  left: 0;
  width: 100%;
  height: 50%; /* Высота отражения */
  background: inherit; /* Копируем фон родителя */
  transform: scaleY(-1); /* Переворачиваем по вертикали */
  opacity: 0.3;


  mask-image: linear-gradient(
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.5) 70%,
      rgba(0, 0, 0, 1) 100%
  );
  -webkit-mask-image: linear-gradient(
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.5) 70%,
      rgba(0, 0, 0, 1) 100%
  );
}
.main-tile__media::before{
  filter: blur(4px);
}
.main-tile__shade::before{
  border-radius: 15px;
  border: 2px solid #42c9ff;
}

.main-page__cards .main-tile__num {
  right: 8%;
  top: 5%;
  font-size: clamp(12px, 1.05vw, 22px);
}

.main-tile--md .main-tile__num {
  right: 8%;
  top: 5%;
  font-size: clamp(10px, 0.85vw, 16px);
}

.main-tile--sm .main-tile__num {
  right: 8%;
  top: 5%;
  font-size: clamp(8px, 0.65vw, 12px);
}

/* Фоны карточек: в Vue задаются через inline --tile-bg на .main-tile */

@media (max-width: 900px) {
  .main-page__frame {
    aspect-ratio: auto;
    min-height: 100vh;
    height: auto;
    padding-bottom: 48px;
  }

  .main-page__cards {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 16px 80px;
    pointer-events: auto;
  }

  .main-tile {
    width: min(78vw, 520px);
    max-width: 600px;
    height: 180px !important;
    margin: 0;
    position: relative;
    left: auto;
    top: auto;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .main-page__deco {
    display: none;
  }

  .main-page__logo {
    position: relative;
    left: auto;
    top: auto;
    width: min(240px, 60%);
    margin: 24px auto 8px;
  }

  .main-page__rail,
  .main-page__glow--top {
    display: none;
  }

  .main-page__overlay-video {
    width: 94%;
  }

  .main-page__overlay-video--circles {
    top: 210px;
  }

  .main-page__about-link-wrap {
    top: 100px;
    padding: 3px;
  }

  .main-page__about-link {
    min-width: 220px;
    min-height: 56px;
    font-size: 18px;
  }

  .main-page__about-link-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }
}

.main-page__subsections {
  position: absolute;
  left: 50%;
  top: calc(55% + 220px);
  transform: translateX(-50%);
  z-index: 6;
  width: min(760px, 72vw);
  text-align: center;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.main-page__subsection-item {
  display: inline-block;
  color: #79dbff;
  font-family: "Conthrax Regular", var(--font-family), sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(14px, 1.05vw, 22px);
  line-height: 1.45;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  text-decoration: none;
  transition: color 0.18s ease;
}

.main-page__subsection-item:hover {
  color: #fff;
}

@media (max-width: 900px) {
  .main-page__subsections {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    padding: 0 16px;
    margin-top: 10px;
  }
}

/* ===========================
   Popup / Modal for card clicks
   =========================== */
.main-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: flex-start;
  padding: 0 clamp(12px, 3vmin, 40px);
  box-sizing: border-box;
}

.main-modal.is-open {
  display: flex;
  flex-direction: column;
}

.main-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 19, 42, 0.40);
  backdrop-filter: blur(15px);
}

.main-modal__panel {
  position: relative;
  width: min(1100px, 92vw);
  max-height: min(72vh, calc(100dvh - 20vh - 12px));
  margin: 20vh 0 0;
  border-radius: 40px;
  background: rgba(0, 47, 101, 0.55);
  backdrop-filter: blur(50px);
  border: 3px solid rgba(66, 201, 255, 0.55);
  overflow-x: hidden;
  overflow-y: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.main-modal__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 47, 101, 0.75) 0%, rgba(0, 47, 101, 0.25) 50%, rgba(0, 47, 101, 0.6) 100%);
  z-index: 0;
}

.main-modal__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 100;
}

.main-modal__close img {
  width: 20px;
  height: 20px;
}

.main-modal__cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  z-index: 0;
}

.main-modal__content {
  padding: 28px 36px 34px;
  position: relative;
  z-index: 1;
}

.main-modal__header {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.main-modal__num {
  font-family: "Conthrax SemiBold", var(--font-family), sans-serif;
  font-weight: 600;
  color: #42c9ff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 20px;
}

.main-modal__title {
  font-family: "Conthrax SemiBold", var(--font-family), sans-serif;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(20px, 3vw, 36px);
  line-height: 1.2;
}

.main-modal__divider {
  margin-top: 100px;
  margin-bottom: 18px;
  width: 100%;
  height: 2px;
  background: #79DBFF;
}

.main-modal__lead {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.85);
  font-family: "Conthrax Regular", var(--font-family), sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.45;
  overflow: hidden;

  color: #79DBFF;

  font-family: "Conthrax Regular";
  font-size: 26px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 1.3px;
}

.main-modal__list {
  display: flex;
  gap: 14px;
  flex-direction: column;
}

.main-modal__item {
  position: relative;
  border-radius: 15px;
  padding: 6px 0;
  min-height: 28px;
  overflow: hidden;
}

/* RouterLink: вся строка ведёт в каталог */
.main-modal__item--nav {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.main-modal__item--nav:hover .main-modal__item-title {
  color: #79dbff;
}

.main-modal__item-title {
  font-family: "Conthrax Regular", var(--font-family), sans-serif;
  font-weight: 400;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 28px;
  line-height: 1.35;
}

.main-modal__item-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.main-modal__item-marker {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: url("../images/main/list_item.png") center / contain no-repeat;
  opacity: 0.95;
}

.main-modal__item-num {
  font-family: "Conthrax Regular", var(--font-family), sans-serif;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
  font-size: 18px;
  min-width: 36px;
  text-align: right;
}

@media (max-width: 900px) {
  .main-modal__panel {
    max-height: min(88vh, 100dvh - 20px);
  }

  .main-modal__content {
    padding: 20px 16px 20px;
  }

  .main-modal__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}