/* ════════════════════════════════════════════════════════════════════════════
 * VistoShield homepage hero — animated dashboard preview
 * ════════════════════════════════════════════════════════════════════════════
 *
 * Pure HTML/CSS animation (no JS, no MP4, no images beyond SVG icons inline).
 * Replaces the static shield SVG that used to sit in .hero__visual.
 *
 * Scene loop (24 s total):
 *   0–6 s   Scene 1 — Live attack feed (rows scrolling, threats blocked counter)
 *   6–12 s  Scene 2 — Security score 64 → 92 (animated ring + module badges)
 *   12–18 s Scene 3 — 14 modules grid lighting up
 *   18–24 s Scene 4 — Tagline + EU-hosted seal
 *
 * Bandwidth: ~6 KB CSS + ~2 KB inline SVG → 50× lighter than the smallest
 * MP4 (18 MB) and infinitely faster to first paint.
 *
 * Accessibility:
 *   - aria-label on the wrapper announces "VistoShield dashboard preview"
 *   - All inner text marked aria-hidden (decorative; the hero copy carries
 *     the real semantic content for SR users)
 *   - prefers-reduced-motion media query freezes the animation on Scene 4
 *     (the brand seal — the most static + branded frame)
 *
 * Layout:
 *   - 540×360 default (3:2 aspect ratio, like a laptop screen)
 *   - Scales down via container query (no JS) on narrow viewports
 *   - .hero__visual already has display:none below the breakpoint, so this
 *     never renders on mobile (decorative only)
 *
 * ════════════════════════════════════════════════════════════════════════════ */

.vs-hero-anim {
    --vs-anim-w: 540px;
    --vs-anim-h: 360px;
    --vs-bg: #0a0e2e;
    --vs-bg-2: #131846;
    --vs-card: #1a1f5c;
    --vs-card-light: #242b6e;
    --vs-text: #f1f5f9;
    --vs-text-dim: #94a3b8;
    --vs-text-faint: #64748b;
    --vs-teal: #14b8a6;
    --vs-teal-glow: rgba(20, 184, 166, .35);
    --vs-success: #22c55e;
    --vs-warn: #f59e0b;
    --vs-danger: #ef4444;
    --vs-border: rgba(148, 163, 184, .18);

    width: var(--vs-anim-w);
    height: var(--vs-anim-h);
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(155deg, var(--vs-bg) 0%, var(--vs-bg-2) 100%);
    box-shadow:
        0 25px 60px -15px rgba(0, 0, 0, .55),
        0 8px 20px -5px rgba(20, 184, 166, .15),
        0 0 0 1px rgba(148, 163, 184, .12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    color: var(--vs-text);
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

@media (max-width: 1180px) {
    .vs-hero-anim { --vs-anim-w: 480px; --vs-anim-h: 320px; }
}

/* ── Browser-window chrome (titlebar) ─────────────────────────────────── */
.vs-hero-anim__bar {
    height: 28px;
    padding: 0 12px;
    background: rgba(255, 255, 255, .04);
    border-bottom: 1px solid var(--vs-border);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.vs-hero-anim__dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: rgba(148, 163, 184, .35);
}
.vs-hero-anim__dot:nth-child(1) { background: #ff5f56; }
.vs-hero-anim__dot:nth-child(2) { background: #ffbd2e; }
.vs-hero-anim__dot:nth-child(3) { background: #27c93f; }
.vs-hero-anim__favicon {
    width: 13px; height: 13px;
    margin-left: 10px;
    color: var(--vs-teal);
    flex-shrink: 0;
}
.vs-hero-anim__url {
    margin-left: 6px;
    font-size: 11px;
    color: var(--vs-text-dim);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .2px;
}
.vs-hero-anim__live {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--vs-success);
    text-transform: uppercase;
    letter-spacing: .8px;
    font-weight: 600;
}
.vs-hero-anim__live::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--vs-success);
    animation: vs-pulse-dot 1.6s ease-in-out infinite;
}
@keyframes vs-pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
    50% { opacity: .55; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ── Stage (where scenes paint) ───────────────────────────────────────── */
.vs-hero-anim__stage {
    position: relative;
    width: 100%;
    height: calc(var(--vs-anim-h) - 28px);
    overflow: hidden;
}

.vs-scene {
    position: absolute;
    inset: 0;
    padding: 18px 22px;
    opacity: 0;
}

/* Visibility schedule (24 s loop). Each scene gets its own keyframe
   animation that holds it visible for ~5 s and crossfades to the next. */
.vs-scene--feed    { animation: vs-scene-1 24s ease-in-out infinite; }
.vs-scene--score   { animation: vs-scene-2 24s ease-in-out infinite; }
.vs-scene--modules { animation: vs-scene-3 24s ease-in-out infinite; }
.vs-scene--final   { animation: vs-scene-4 24s ease-in-out infinite; }

@keyframes vs-scene-1 { 0%,1% { opacity: 0; } 2%,23% { opacity: 1; } 25%,100% { opacity: 0; } }
@keyframes vs-scene-2 { 0%,24% { opacity: 0; } 26%,48% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes vs-scene-3 { 0%,49% { opacity: 0; } 51%,73% { opacity: 1; } 75%,100% { opacity: 0; } }
@keyframes vs-scene-4 { 0%,74% { opacity: 0; } 76%,98% { opacity: 1; } 100% { opacity: 0; } }

/* ════════════════════════════════════════════════════════════════════════
 * SCENE 1 — Live attack feed
 * ════════════════════════════════════════════════════════════════════════ */
.vs-scene--feed h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--vs-text-dim);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vs-scene--feed h3::before {
    content: "";
    width: 16px; height: 2px;
    background: var(--vs-teal);
    border-radius: 1px;
}

.vs-feed-list {
    list-style: none; margin: 0; padding: 0;
    height: 200px; overflow: hidden;
    position: relative;
}
.vs-feed-row {
    display: grid;
    grid-template-columns: 22px 1fr 1.2fr 90px;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--vs-border);
    margin-bottom: 6px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    opacity: 0;
    transform: translateY(20px);
    animation: vs-feed-slide 24s ease-out infinite;
}
.vs-feed-row__flag {
    width: 18px; height: 12px;
    border-radius: 2px;
    background: var(--vs-card-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px;
    color: var(--vs-text-dim);
}
.vs-feed-row__ip { color: var(--vs-text); font-weight: 500; }
.vs-feed-row__path { color: var(--vs-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-feed-row__status {
    text-align: right;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.vs-feed-row--blocked { border-color: rgba(239, 68, 68, .28); background: rgba(239, 68, 68, .07); }
.vs-feed-row--blocked .vs-feed-row__status { color: var(--vs-danger); }
.vs-feed-row--allowed { border-color: rgba(34, 197, 94, .25); background: rgba(34, 197, 94, .06); }
.vs-feed-row--allowed .vs-feed-row__status { color: var(--vs-success); }

/* Stagger 5 rows over scene window (0–6 s); each row appears, holds, fades */
.vs-feed-row:nth-child(1) { animation-delay: 0s;   }
.vs-feed-row:nth-child(2) { animation-delay: 0.7s; }
.vs-feed-row:nth-child(3) { animation-delay: 1.4s; }
.vs-feed-row:nth-child(4) { animation-delay: 2.4s; }
.vs-feed-row:nth-child(5) { animation-delay: 3.4s; }
@keyframes vs-feed-slide {
    0%       { opacity: 0; transform: translateY(20px); }
    1%, 4%   { opacity: 1; transform: translateY(0);    }
    21%, 100%{ opacity: 0; transform: translateY(0);    }
}

.vs-feed-counter {
    margin-top: 14px;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(20, 184, 166, .14), rgba(20, 184, 166, .03));
    border-left: 3px solid var(--vs-teal);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}
.vs-feed-counter__num {
    font-size: 22px;
    font-weight: 800;
    color: var(--vs-teal);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.vs-feed-counter__num::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    color: var(--vs-text-dim);
    font-size: 11px;
    font-weight: 600;
    vertical-align: 4px;
}
.vs-feed-counter__label { color: var(--vs-text-dim); font-size: 11px; }

/* ════════════════════════════════════════════════════════════════════════
 * SCENE 2 — Security score animation (64 → 92)
 * ════════════════════════════════════════════════════════════════════════ */
.vs-scene--score {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 22px;
    align-items: center;
}

.vs-score-ring {
    width: 140px; height: 140px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}
.vs-score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.vs-score-ring circle { fill: none; stroke-width: 10; }
.vs-score-ring__bg     { stroke: rgba(148, 163, 184, .12); }
.vs-score-ring__fill   {
    stroke: url(#vs-grad);
    stroke-linecap: round;
    /* circumference = 2*pi*60 ≈ 377 */
    stroke-dasharray: 377;
    stroke-dashoffset: 136;     /* default = 64% filled */
    animation: vs-score-fill 6s ease-out infinite;
}
@keyframes vs-score-fill {
    0%       { stroke-dashoffset: 377; }   /* 0%  */
    8%       { stroke-dashoffset: 136; }   /* 64% */
    50%      { stroke-dashoffset: 31;  }   /* 92% */
    100%     { stroke-dashoffset: 31;  }
}

.vs-score-ring__num {
    position: absolute;
    font-size: 38px;
    font-weight: 800;
    color: var(--vs-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}
.vs-score-ring__num::after {
    content: attr(data-num);
    animation: vs-score-num 6s ease-out infinite;
}
@keyframes vs-score-num {
    /* CSS can't tween text content, so instead use a slot animation that
       cycles through 64, 70, 78, 85, 88, 92 via opacity-stack of spans */
    0%, 100% { opacity: 1; }
}
.vs-score-ring__num span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}
.vs-score-ring__num span:nth-child(1) { animation: vs-score-step 6s steps(1) infinite;       animation-delay: 0s; }
.vs-score-ring__num span:nth-child(2) { animation: vs-score-step 6s steps(1) infinite;       animation-delay: 0.5s; }
.vs-score-ring__num span:nth-child(3) { animation: vs-score-step 6s steps(1) infinite;       animation-delay: 1.1s; }
.vs-score-ring__num span:nth-child(4) { animation: vs-score-step 6s steps(1) infinite;       animation-delay: 1.7s; }
.vs-score-ring__num span:nth-child(5) { animation: vs-score-step 6s steps(1) infinite;       animation-delay: 2.3s; }
.vs-score-ring__num span:nth-child(6) { animation: vs-score-step-final 6s steps(1) infinite; animation-delay: 3s; }
@keyframes vs-score-step       { 0%, 8% { opacity: 1; } 9%, 100% { opacity: 0; } }
@keyframes vs-score-step-final { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.vs-score-meta {
    font-size: 11px;
    color: var(--vs-text-dim);
    margin-top: 4px;
    text-align: center;
    width: 100%;
    position: absolute;
    bottom: -22px;
}

.vs-score-badges { display: flex; flex-direction: column; gap: 8px; }
.vs-score-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--vs-border);
    border-radius: 6px;
    font-size: 11px;
    color: var(--vs-text-dim);
    opacity: 0;
    transform: translateX(10px);
    animation: vs-badge-in 6s ease-out infinite;
}
.vs-score-badge::before {
    content: "✓";
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(34, 197, 94, .18);
    color: var(--vs-success);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}
.vs-score-badge:nth-child(1) { animation-delay: 1.0s; }
.vs-score-badge:nth-child(2) { animation-delay: 1.7s; }
.vs-score-badge:nth-child(3) { animation-delay: 2.4s; }
.vs-score-badge:nth-child(4) { animation-delay: 3.1s; }
@keyframes vs-badge-in {
    0%       { opacity: 0; transform: translateX(10px); }
    8%, 50%  { opacity: 1; transform: translateX(0);    }
    58%, 100%{ opacity: 0; transform: translateX(0);    }
}

/* ════════════════════════════════════════════════════════════════════════
 * SCENE 3 — 14 modules grid
 * ════════════════════════════════════════════════════════════════════════ */
.vs-scene--modules h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--vs-text-dim);
    margin: 0 0 14px;
    text-align: center;
}
.vs-modules-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 7px;
}
.vs-module-tile {
    aspect-ratio: 1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--vs-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: var(--vs-text-dim);
    font-size: 8.5px;
    text-align: center;
    line-height: 1.15;
    opacity: 0;
    transform: scale(.92);
    animation: vs-module-pop 6s ease-out infinite;
}
.vs-module-tile svg { width: 16px; height: 16px; margin-bottom: 3px; }
@keyframes vs-module-pop {
    0%       { opacity: 0; transform: scale(.92);
               background: rgba(255,255,255,.04); border-color: var(--vs-border);
               color: var(--vs-text-dim); }
    8%       { opacity: 1; transform: scale(1.06);
               background: rgba(20, 184, 166, .22); border-color: var(--vs-teal);
               color: var(--vs-teal); }
    14%, 80% { opacity: 1; transform: scale(1);
               background: rgba(20, 184, 166, .12); border-color: rgba(20, 184, 166, .45);
               color: var(--vs-teal); }
    88%, 100%{ opacity: 0; }
}
/* Stagger 14 tiles over ~3.5s, so ring is full by 5s, hold for 1s, fade */
.vs-module-tile:nth-child(1)  { animation-delay: 0.00s; }
.vs-module-tile:nth-child(2)  { animation-delay: 0.18s; }
.vs-module-tile:nth-child(3)  { animation-delay: 0.36s; }
.vs-module-tile:nth-child(4)  { animation-delay: 0.54s; }
.vs-module-tile:nth-child(5)  { animation-delay: 0.72s; }
.vs-module-tile:nth-child(6)  { animation-delay: 0.90s; }
.vs-module-tile:nth-child(7)  { animation-delay: 1.08s; }
.vs-module-tile:nth-child(8)  { animation-delay: 1.26s; }
.vs-module-tile:nth-child(9)  { animation-delay: 1.44s; }
.vs-module-tile:nth-child(10) { animation-delay: 1.62s; }
.vs-module-tile:nth-child(11) { animation-delay: 1.80s; }
.vs-module-tile:nth-child(12) { animation-delay: 1.98s; }
.vs-module-tile:nth-child(13) { animation-delay: 2.16s; }
.vs-module-tile:nth-child(14) { animation-delay: 2.34s; }

.vs-modules-foot {
    margin-top: 14px;
    text-align: center;
    font-size: 11px;
    color: var(--vs-text-dim);
}
.vs-modules-foot strong { color: var(--vs-teal); font-weight: 700; }

/* ════════════════════════════════════════════════════════════════════════
 * SCENE 4 — Final tagline + EU seal
 * ════════════════════════════════════════════════════════════════════════ */
.vs-scene--final {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
}
.vs-final-shield {
    width: 72px; height: 72px;
    color: var(--vs-teal);
    filter: drop-shadow(0 0 14px var(--vs-teal-glow));
    animation: vs-shield-bob 3s ease-in-out infinite;
}
@keyframes vs-shield-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
.vs-final-name {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--vs-text);
}
.vs-final-tagline {
    font-size: 13px;
    color: var(--vs-text-dim);
    line-height: 1.5;
}
.vs-final-tagline strong { color: var(--vs-teal); font-weight: 600; }
.vs-final-seal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--vs-border);
    border-radius: 999px;
    font-size: 11px;
    color: var(--vs-text-dim);
    margin-top: 2px;
}
.vs-final-seal__flag {
    display: inline-flex;
    align-items: center;
    width: 18px; height: 12px;
    background: #003399;
    border-radius: 2px;
    position: relative;
}
.vs-final-seal__flag::before {
    /* 12-star ring approximation: center dot for visual cue at 18×12 */
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #ffcc00;
    margin: auto;
    flex: 1;
}

/* ════════════════════════════════════════════════════════════════════════
 * Reduced-motion: freeze on Scene 4 (most static, branded frame)
 * ════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .vs-hero-anim *,
    .vs-hero-anim *::before,
    .vs-hero-anim *::after { animation: none !important; }
    .vs-scene { opacity: 0; }
    .vs-scene--final { opacity: 1; }
    .vs-feed-row,
    .vs-score-badge,
    .vs-module-tile { opacity: 1; transform: none; }
    .vs-score-ring__fill { stroke-dashoffset: 31; }
    .vs-score-ring__num span:last-child { opacity: 1; }
}
