/* =========================================================
   АэроБин — анимация
   1. Дрон над планетой на первом экране
   2. Появление блоков при прокрутке и счётчики
   3. Экран оператора
   4. Живые карточки дронов
   ========================================================= */

/* ---------- 1. Дрон над планетой ---------- */
.hero-drone {
    position: absolute;
    left: 2%;
    top: 7%;
    width: 25%;
    z-index: 3;
    pointer-events: none;
    animation: drone-arrive 2.4s cubic-bezier(0.16, 0.84, 0.3, 1) 0.3s both;
}
.hero-drone__body {
    position: relative;
    animation: drone-hover 6.5s ease-in-out 2.7s infinite;
}
.hero-drone__body img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: auto;
    filter: brightness(1.45) contrast(1.05) drop-shadow(0 0 18px rgba(169, 188, 232, 0.45)) !important;
}
.hero-drone__beam {
    position: absolute;
    left: 50%;
    top: 74%;
    width: 150%;
    height: 165%;
    transform: translateX(-50%);
    z-index: 1;
    opacity: 0;
    mix-blend-mode: screen;
    animation: beam-on 0.9s ease 2.4s forwards;
}
.hero-drone__cone {
    position: absolute;
    inset: 0;
    clip-path: polygon(47% 0, 53% 0, 100% 100%, 0 100%);
    background: linear-gradient(180deg, rgba(205, 218, 255, 0.16) 0%, rgba(205, 218, 255, 0.05) 60%, transparent 100%);
    animation: beam-breathe 5s ease-in-out 3.3s infinite;
}
.hero-drone__scan {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(232, 238, 255, 0.95) 50%, transparent 100%);
    box-shadow: 0 0 14px rgba(200, 214, 255, 0.9);
    animation: beam-scan 2.8s cubic-bezier(0.45, 0, 0.55, 1) 3.3s infinite;
    opacity: 0;
}
.hero-drone__spot {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: -7%;
    height: 15%;
    border-radius: 50%;
    border: 1px solid rgba(214, 224, 255, 0.18);
    background: radial-gradient(ellipse at center, rgba(214, 224, 255, 0.12), transparent 70%);
    animation: spot-pulse 2.8s ease-in-out 3.3s infinite;
}
@keyframes drone-arrive {
    from { transform: translate(190%, -170%) rotate(-10deg) scale(0.6); opacity: 0; }
    35%  { opacity: 1; }
    to   { transform: none; opacity: 1; }
}
@keyframes drone-hover {
    0%, 100% { transform: translateY(0) rotate(-1.2deg); }
    50%      { transform: translateY(-10px) rotate(1.2deg); }
}
@keyframes beam-on { to { opacity: 1; } }
@keyframes beam-breathe {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}
@keyframes beam-scan {
    0%   { top: 0; opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}
@keyframes spot-pulse {
    0%, 70% { opacity: 0.45; transform: scale(0.96); }
    88%     { opacity: 1; transform: scale(1.04); }
    100%    { opacity: 0.45; transform: scale(0.96); }
}

/* ---------- 2. Появление при прокрутке ---------- */
.rv {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rv-delay, 0ms),
                transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rv-delay, 0ms) !important;
}
.rv.rv-in { opacity: 1; transform: none; }

/* Ключевые цифры на страницах моделей */
.key-stats {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    max-width: 860px;
    margin: 40px auto 0 !important;
    padding: 0 !important;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.key-stats li {
    padding: 22px 12px;
    text-align: center;
    border-left: 1px solid var(--line);
}
.key-stats li:first-child { border-left: 0; }
.ks-num {
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 200;
    letter-spacing: -0.03em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.ks-unit { margin-left: 6px; font-size: 1rem; color: var(--text-2); }
.ks-label { display: block; margin-top: 4px; font-size: 0.88rem; color: var(--muted); }
@media (max-width: 640px) {
    .key-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .key-stats li:nth-child(3) { border-left: 0; }
    .key-stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- 3. Экран оператора ---------- */
.ops-console {
    margin-top: 56px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg, 24px);
    background: linear-gradient(180deg, rgba(10, 13, 31, 0.92), rgba(5, 6, 15, 0.92));
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}
.ops-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    font-size: 0.88rem;
    color: var(--muted);
}
.ops-bar strong { color: var(--text) !important; font-weight: 500 !important; }
.ops-status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ops-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7fd6a4;
    box-shadow: 0 0 10px #7fd6a4;
    animation: ops-blink 2s ease-in-out infinite;
}
.ops-body {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
}
.ops-map { position: relative; border-right: 1px solid var(--line); }
.ops-map svg { display: block; width: 100%; height: auto; }
.ops-log {
    list-style: none;
    margin: 0;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100%;
    overflow: hidden;
}
.ops-log li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.86rem;
    line-height: 1.4;
    color: var(--text-2);
    animation: log-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.ops-log li time { color: var(--muted); font-variant-numeric: tabular-nums; }
.ops-log li.is-alarm {
    border-color: rgba(240, 182, 90, 0.35);
    background: rgba(240, 182, 90, 0.07);
    color: #f3d8a8;
}
.ops-log li.is-alarm time { color: #f0b65a; }
.ops-log li.is-old { opacity: 0.45; }
.ops-caption { margin-top: 14px; text-align: center; font-size: 0.85rem; color: var(--muted) !important; max-width: none !important; }
.ops-alarm-ring { transform-box: fill-box; transform-origin: center; animation: alarm-ring 1.8s ease-out infinite; }
@keyframes ops-blink { 50% { opacity: 0.35; } }
@keyframes log-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes alarm-ring {
    from { transform: scale(0.6); opacity: 0.9; }
    to   { transform: scale(2.6); opacity: 0; }
}
@media (max-width: 860px) {
    .ops-body { grid-template-columns: 1fr; }
    .ops-map { border-right: 0; border-bottom: 1px solid var(--line); }
    .ops-log { max-height: 270px; }
    .ops-bar { flex-wrap: wrap; }
}

/* ---------- 4. Живые карточки дронов ---------- */
.tilt-host { perspective: 900px; }
.tilt {
    display: block;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    will-change: transform;
}
.tilt.is-tracking { transition: transform 0.12s linear; }
.tilt img { animation: drone-idle 7s ease-in-out infinite; }
.tilt-host::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 40%), rgba(214, 224, 255, 0.10), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
.tilt-host.is-hover::after { opacity: 1; }
@keyframes drone-idle {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

/* ---------- Мобильные и «уменьшить движение» ---------- */
@media (max-width: 768px) {
    .hero-drone { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .rv { opacity: 1 !important; transform: none !important; }
    .hero-drone__scan { display: none; }
    .hero-drone__beam { opacity: 1 !important; }
}

/* Карточки с рендерами: одинаковая высота картинок, подписи на одной линии */
.media-card.dark-img img {
    aspect-ratio: 4 / 3;
    object-fit: contain;
    padding: 6%;
    box-sizing: border-box;
}
.media-card.dark-img figcaption { margin-top: auto; }
