/* Сцена главной страницы: статус, робот, живое небо, кнопка «Скачать», три
   шага. Перенесено из принятого макета docs/roadmap/maket-sajt-robot.html —
   та же синяя палитра и тот же приём наложения видео на стыках состояний
   (без чёрных вспышек). Небо сайта с 21.09.2026 НЕ копия неба приложения:
   почему — в шапке home.js и в docs/DECISIONS_LOG.md.
   Стили не общие для всех страниц (в отличие от shared.css), поэтому лежат
   отдельно — их грузит только index.html. */

#p-home { position: relative; }

#sky {
  position: absolute;
  left: -24px;
  top: 0;
  width: calc(100% + 48px);
  pointer-events: none;
  z-index: 1;
}

.robot-header { position: relative; z-index: 2; }
.robot-header .brand { display: block; margin-bottom: 16px; }

#status {
  font-family: "Russo One", "Play", system-ui, sans-serif;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.14;
  margin: 0 0 8px;
  transition: color 0.3s;
}

[data-robot-state="connected"] #status {
  color: #37e0a1;
  text-shadow: 0 0 24px rgba(55, 224, 161, 0.35);
}

#sub { color: var(--muted); font-size: 15px; margin: 0; }

.robot {
  position: relative;
  width: calc(100% + 48px);
  margin: -36px -24px 0;
  aspect-ratio: 9 / 14;
  cursor: pointer;
  z-index: 0;
  /* Тот же кадр, что и poster="" видео ниже — якорь 50% 80% держим
     одинаковым в обоих местах (находка круга 1: расхождение якорей давало
     видимый прыжок кадра), чтобы отказ автозапуска (markAutoplayBlocked
     прячет <video>, включая его poster) не сдвигал робота по вертикали. */
  background: 50% 80% / cover no-repeat url("/media/v1/robot_poster.jpg"), #05070e;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 88%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 88%, transparent 100%);
}

.robot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 80%;
  opacity: 0;
  transition: opacity 0.25s linear;
}

.robot video:not(.hide) { opacity: 1; }

#hint {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bfe3ff;
  text-shadow: 0 0 10px var(--glow);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.3s;
  z-index: 2;
}

[data-robot-state="connecting"] #hint,
[data-robot-state="connected"] #hint { opacity: 0; }

#p-home .actions { position: relative; z-index: 2; margin-top: 8px; }

#p-home .steps {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

#p-home .step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

#p-home .step .n {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 14px "Russo One", sans-serif;
  color: var(--accent);
  border: 1px solid rgba(58, 169, 255, 0.4);
}

#p-home .step h2 {
  font: 500 16px "Russo One", "Play", sans-serif;
  margin: 4px 0 4px;
}

#p-home .step p { margin: 0; color: var(--muted); font-size: 14px; }

@media (min-width: 980px) {
  #p-home {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: 32px;
    align-items: center;
    min-height: calc(100vh - 160px);
  }
  .robot-header { grid-column: 1; grid-row: 1 / 5; }
  #status { font-size: clamp(34px, 3.4vw, 50px); }
  #sub { font-size: 17px; }
  .robot {
    grid-column: 2;
    grid-row: 1 / 5;
    width: auto;
    margin: 0;
    height: min(calc(100vh - 160px), 780px);
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
            mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
  }
  #hint { display: none; }
  #p-home .actions { grid-column: 3; grid-row: 2; margin-top: 0; }
  #p-home .steps { grid-column: 3; grid-row: 3; margin-top: 18px; }

  #sky { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 0; }
  .robot { position: relative; z-index: 1; }
  .robot-header, #p-home .actions, #p-home .steps { position: relative; z-index: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .robot video { transition: none; }
}
