/* Перший екран: жива анімація (та сама, що в ролику video/anim.html).
   Кадр 1920×1080 масштабується під екран як відео (cover, зсув 20% по горизонталі).
   Перший екран завжди нічний — у світлій і темній темі однаковий. */
.lhero { position: relative; height: 100vh; height: 100svh; min-height: 520px; background: #070b11; overflow: hidden; color-scheme: dark; }
.lh-frame { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; }
.lh-scene { position: absolute; inset: 0; }
.lh-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.lh-stage img.lh-base { position: absolute; left: 0; top: 0; display: block; max-width: none; }
.lh-layer { position: absolute; background-repeat: no-repeat; background-size: 100% 100%; opacity: 0; }
.lh-tiles { position: absolute; inset: 0; perspective: 1600px; perspective-origin: 55% 40%; }
.lh-tile { position: absolute; opacity: 0; will-change: transform, opacity; }
.lh-tile .lh-skin { position: absolute; inset: 0; background-repeat: no-repeat; }
.lh-tile .lh-back { position: absolute; inset: 0; background: linear-gradient(135deg, #e8d58e, #c9b46a); transform: translate(7px, 5px); opacity: var(--back, 0); }
.lh-tile svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lh-tile polygon { fill: none; stroke: #328fff; stroke-width: 1.8; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px #328fff); opacity: var(--glow, 0); }
.lh-shade { position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: linear-gradient(90deg, #070b11e6 0%, #070b11a6 22%, #070b1100 46%),
              linear-gradient(0deg, #070b11cc 0%, #070b1100 22%); }
.lh-cap { position: absolute; left: 72px; bottom: 120px; width: 760px; opacity: 0; z-index: 5; }
.lh-cap .lh-eb { font: 500 18px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: #c9d2dc; margin-bottom: 22px; }
.lh-cap .lh-eb b { color: #328fff; font-weight: 700; }
.lh-cap .lh-h { margin: 0; font: 800 64px/1.04 var(--f-display); text-transform: uppercase; color: #f4f7fb; letter-spacing: -.01em; }
.lh-cap .lh-h em { font-style: normal; color: #328fff; }
.lh-cap p { margin: 22px 0 0; font: 500 24px/1.45 var(--f-body); color: #c9d2dc; max-width: 640px; }
.lh-rail { position: absolute; left: 72px; bottom: 64px; display: flex; gap: 14px; align-items: center; font: 500 16px/1 var(--f-body); color: #8592a3; z-index: 5; }
.lh-rail span.on { color: #328fff; font-weight: 700; }
.lh-rail i { width: 64px; height: 2px; background: #2c3d52; position: relative; overflow: hidden; display: block; }
.lh-rail i::after { content: ""; position: absolute; inset: 0; background: #328fff; transform: scaleX(var(--p, 0)); transform-origin: left; }
.lh-flash { position: absolute; inset: 0; background: #070b11; opacity: 0; pointer-events: none; z-index: 5; }
.lh-end { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; opacity: 0; z-index: 5; }
.lh-end p { margin: 0; font: 800 54px/1.15 var(--f-display); text-transform: uppercase; white-space: nowrap; color: #c9d2dc; }
.lh-end p em { font-style: normal; color: #328fff; }

.lhero__ui {
  position: absolute; left: 50%; bottom: clamp(28px, 7vh, 72px); transform: translate(-50%, 16px); z-index: 6;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity .6s ease, transform .6s ease; width: max-content; max-width: calc(100% - 32px);
}
.lhero.is-done .lhero__ui { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.lhero__replay { background: none; border: 0; color: #cfd8e3; font: 600 14px/1 var(--f-body); display: inline-flex; gap: 8px; align-items: center; cursor: pointer; padding: 10px 6px; }
.lhero__replay svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.lhero__replay:hover { color: #fff; }
.lhero .btn--line { color: #f2f5f9; background: #0a0f1680; border-color: #328fff; }
.lhero .btn--solid { background: #328fff; }

@media (max-width: 860px) {
  .lhero { height: auto; min-height: 0; padding-top: calc(var(--hdr-h) + env(safe-area-inset-top, 0px)); }
  .lhero__box { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; }
  .lhero__ui { position: static; transform: none; margin: 20px auto 28px; opacity: 1; pointer-events: auto; width: auto; }
  .lhero.is-done .lhero__ui { transform: none; }
  .lhero__ui .btn { flex: 1 1 100%; justify-content: center; }
}
@media (min-width: 861px) { .lhero__box { position: absolute; inset: 0; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
