/* ============================================================
   Mavix Web — landing.css
   Стили лендинга: hero, секции, фичи, архитектура, видео, CTA.
   Также фоновый эффект bg-fx и утилита reveal (используются только на index.html).
   ============================================================ */

/* ----------------------------------------------------------
   Фоновый эффект: плавающие cyan/blue-пятна (только index.html)
   ---------------------------------------------------------- */

.bg-fx {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.bg-fx-blob {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.10;
  will-change: transform;
}

.bg-fx-blob-1 {
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
  animation: bg-float-1 32s ease-in-out infinite;
}

.bg-fx-blob-2 {
  top: 30%;
  right: -100px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #1d4ed8 0%, transparent 65%);
  opacity: 0.12;
  animation: bg-float-2 40s ease-in-out infinite;
}

.bg-fx-blob-3 {
  bottom: -100px;
  left: 38%;
  background: radial-gradient(circle, var(--accent-press) 0%, transparent 65%);
  animation: bg-float-3 36s ease-in-out infinite;
}

@keyframes bg-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(80px, 140px) scale(1.1); }
}

@keyframes bg-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-120px, -100px) scale(1.08); }
}

@keyframes bg-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(60px, -140px) scale(1.12); }
}

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

/* ----------------------------------------------------------
   Появление секций при скролле (включается из reveal.js)
   ---------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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



/* ----------------------------------------------------------
   Лендинг: hero
   ---------------------------------------------------------- */

/* Якоря лендинга: цель скролла — eyebrow раздела (а не верх
   секции). Хотим, чтобы после якорного перехода eyebrow
   оказывался на ~20px ниже sticky-шапки.

   eyebrow_y = section_top_y + section_padding_top
   section_top_y = scroll-margin-top
   ⇒ scroll-margin-top = (header-height + 20px) − section_padding_top

   Базовая .section имеет padding-top: 96px, у #architecture и
   #about inline style 32px — соответственно две разные формулы. */
#features {
  scroll-margin-top: calc(var(--header-height) + 20px - 96px);
}

#architecture,
#about {
  scroll-margin-top: calc(var(--header-height) + 20px - 32px);
}

.hero {
  position: relative;
  padding: 56px 0 48px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 500px at 50% -10%, rgba(0, 217, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 600px 400px at 80% 50%, rgba(0, 217, 255, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 39, 51, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 39, 51, 0.4) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(40px, 6.4vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 16px 0 18px;
  background: linear-gradient(180deg, var(--text) 0%, var(--muted-strong) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title .accent {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-press) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-soft);
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto 24px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  color: var(--text);
  font-weight: 600;
}

.hero-stat-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--fs-xs);
}

/* ----------------------------------------------------------
   Секции
   ---------------------------------------------------------- */

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}

.section-title {
  font-size: clamp(28px, 3.4vw, 42px);
  margin: 18px 0 16px;
  letter-spacing: -0.03em;
}

.section-sub {
  color: var(--text-soft);
  font-size: var(--fs-lg);
  line-height: 1.6;
}

/* Features grid */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

.feature:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-md);
  border: 1px solid rgba(0, 217, 255, 0.2);
}

.feature-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
}

.feature-desc {
  color: var(--text-soft);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   Архитектура (триангулярная диаграмма: сервер / дрон / оператор)
   локальный акцент для архитектурной схемы (не выносим в base.css)
   ---------------------------------------------------------- */

.arch-head {
  margin-bottom: 28px;
}

.arch-title {
  font-size: var(--fs-5xl);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
  line-height: 1.1;
}

.arch-sub {
  font-size: var(--fs-md);
  color: var(--muted);
  margin: 0;
}

.arch-diagram {
  --arch-pink: #ec4899;          /* локальный акцент схемы (rose/pink) */
  --arch-pink-soft: rgba(236, 72, 153, 0.18);
  --arch-line: rgba(136, 147, 164, 0.45); /* приглушённая серая линия */

  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    ".      server    .       "
    "drone  .         operator";
  column-gap: 32px;
  row-gap: 120px;
  align-items: start;
  padding: 16px 0 8px 0;
  min-height: 520px;
}

/* SVG с линиями-связями — слой ниже нод */
.arch-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.arch-line {
  fill: none;
  stroke-linecap: round;
}

.arch-line-thin {
  stroke: var(--arch-line);
  stroke-width: 1.5;
}

.arch-line-p2p {
  stroke: var(--arch-pink);
  stroke-width: 3.5;
  filter: drop-shadow(0 0 6px var(--arch-pink-soft));
}

/* Ноды */
.arch-node {
  position: relative;
  z-index: 2;
  padding: 22px 24px 22px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  max-width: 320px;
}

.arch-node::before {
  /* цветная акцент-полоска слева */
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: var(--r-full);
  background: var(--accent);
}

.arch-node--server {
  grid-area: server;
  justify-self: center;
}

.arch-node--server::before {
  background: var(--accent);
}

.arch-node--drone {
  grid-area: drone;
  justify-self: start;
}

.arch-node--drone::before {
  background: var(--arch-pink);
}

.arch-node--operator {
  grid-area: operator;
  justify-self: end;
}

.arch-node--operator::before {
  background: var(--arch-pink);
}

.arch-node-title {
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.2;
}

.arch-node-desc {
  font-size: var(--fs-sm);
  color: var(--text-soft);
  line-height: 1.55;
  white-space: pre-line;
}

/* Лейблы линий */
.arch-edge-label {
  position: absolute;
  z-index: 1;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.35;
  pointer-events: none;
}

.arch-edge-label--left {
  top: 50%;
  left: 28%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.arch-edge-label--right {
  top: 50%;
  right: 28%;
  transform: translate(50%, -50%);
  text-align: center;
}

.arch-edge-label--p2p {
  left: 50%;
  bottom: 110px;
  transform: translate(-50%, 50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  white-space: nowrap;
  z-index: 3;
}

.arch-p2p-accent {
  color: var(--arch-pink);
  font-weight: 600;
}

.arch-p2p-dot {
  color: var(--muted);
}

.arch-p2p-text {
  color: var(--text-soft);
}

.arch-note {
  text-align: center;
  margin-top: 32px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ---- Адаптив: на узких экранах — вертикальный stacked layout ---- */
@media (max-width: 720px) {
  .arch-diagram {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "server"
      "drone"
      "operator";
    row-gap: 28px;
    min-height: 0;
    padding: 8px 0;
  }

  .arch-lines {
    display: none;
  }

  .arch-edge-label--left,
  .arch-edge-label--right {
    position: static;
    transform: none;
    display: block;
    text-align: center;
    padding: 4px 0;
  }

  .arch-edge-label--p2p {
    position: static;
    transform: none;
    margin: 8px auto;
  }

  .arch-node {
    max-width: 100%;
    justify-self: stretch !important;
  }

  .arch-title {
    font-size: var(--fs-4xl);
  }
}

/* ----------------------------------------------------------
   CTA блок
   ---------------------------------------------------------- */

.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 64px 40px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 217, 255, 0.15), transparent 70%),
    linear-gradient(180deg, var(--card), var(--bg-elev-1));
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  position: relative;
  overflow: hidden;
}

.cta-title {
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.02em;
}

.cta-sub {
  color: var(--text-soft);
  max-width: 540px;
  margin: 0 auto;
}

.cta-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ----------------------------------------------------------
   Контакты
   ---------------------------------------------------------- */

.contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 48px 40px;
  background: linear-gradient(180deg, var(--card), var(--bg-elev-1));
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
}

.contacts-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contacts-title {
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
  margin: 0;
}

.contacts-sub {
  color: var(--text-soft);
  max-width: 440px;
  margin: 0;
  line-height: 1.6;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-elev-1);
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.contact-item:hover {
  border-color: var(--border-focus);
  background: var(--card-hover);
  transform: translateY(-1px);
}

.contact-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.contact-item-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.contact-item-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--fs-base);
  color: var(--text);
  word-break: break-all;
}

@media (max-width: 800px) {
  .contacts {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 24px;
  }
}


/* ----------------------------------------------------------
   Header авторизованного пользователя на лендинге.
   До решения «гость/авторизован» оба блока скрыты через [hidden].
   landing.js после синхронной проверки localStorage снимает hidden
   с нужного блока — это происходит мгновенно, мигания нет.
   ---------------------------------------------------------- */

.header-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.header-actions-group[hidden] {
  display: none;
}

@media (max-width: 600px) {
  /* На узких экранах email прячем — кнопок «Кабинет» и «Выйти» достаточно. */
  [data-role="header-actions-auth"] .header-user { display: none; }
}
