/* ---- Motion & scroll effects (one-page) ---- */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 60;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.04);
}

.scroll-progress__bar {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    box-shadow: 0 0 12px rgba(20, 212, 190, 0.45);
}

.main-header {
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.main-header.is-scrolled {
    background: rgba(5, 12, 30, 0.94);
    border-bottom-color: color-mix(in srgb, var(--brand) 28%, var(--line));
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

.hero {
    position: relative;
    overflow: hidden;
}

.hero__glow,
.hero__mesh {
    position: absolute;
    inset: 0;
    pointer-events: none;
    will-change: transform;
}

.hero__glow {
    background:
        radial-gradient(circle at 18% 22%, rgba(91, 124, 255, 0.34), transparent 42%),
        radial-gradient(circle at 82% 12%, rgba(20, 212, 190, 0.22), transparent 38%);
    animation: hero-glow-drift 14s ease-in-out infinite alternate;
}

.hero__mesh {
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(122, 148, 214, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(122, 148, 214, 0.12) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 88%);
}

.hero__content {
    position: relative;
    z-index: 1;
}

.hero__reveal {
    animation: hero-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__content .kicker.hero__reveal { animation-delay: 0.08s; }
.hero__content h1.hero__reveal { animation-delay: 0.2s; }
.hero__content p.hero__reveal { animation-delay: 0.34s; }
.hero__content .hero-actions.hero__reveal { animation-delay: 0.48s; }

@keyframes hero-rise {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes hero-glow-drift {
    from { transform: translate3d(-2%, 0, 0) scale(1); }
    to { transform: translate3d(2%, -1%, 0) scale(1.04); }
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: btn-shimmer 4.5s ease-in-out infinite;
}

@keyframes btn-shimmer {
    0%, 72% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition:
        opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.card:not(.demo-card) {
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.28s ease,
        border-color 0.28s ease;
}

.card:not(.demo-card):hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.28),
        0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
}

.card-metric {
    position: relative;
}

.card-metric::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 20% 0%, rgba(91, 124, 255, 0.16), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-metric.is-visible::before,
.card-metric:hover::before {
    opacity: 1;
}

.metric {
    font-variant-numeric: tabular-nums;
}

.tag-list li {
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.tag-list li:hover {
    transform: translateY(-2px);
    background: rgba(91, 130, 255, 0.42);
    border-color: color-mix(in srgb, var(--brand-2) 35%, var(--line));
}

.section-rail {
    position: fixed;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 45;
    display: none;
}

.section-rail__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.section-rail__link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.section-rail__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--brand) 55%, var(--line));
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.section-rail__label {
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.section-rail__link:hover .section-rail__label,
.section-rail__link:focus-visible .section-rail__label,
.section-rail__link.is-active .section-rail__label {
    opacity: 1;
    transform: none;
}

.section-rail__link.is-active .section-rail__dot,
.section-rail__link:hover .section-rail__dot {
    transform: scale(1.25);
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 0 12px rgba(20, 212, 190, 0.45);
}

.back-to-top {
    position: fixed;
    right: 1.1rem;
    bottom: 1.25rem;
    z-index: 45;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(8, 16, 38, 0.92);
    color: #eef2ff;
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-to-top:hover {
    background: color-mix(in srgb, var(--brand) 24%, rgba(8, 16, 38, 0.92));
}

.back-to-top:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.back-to-top__icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 1120px) {
    .section-rail {
        display: block;
    }

    .back-to-top {
        right: 1.1rem;
        bottom: 1.25rem;
    }
}

@media (max-width: 1119px) {
    .back-to-top {
        right: 1rem;
        bottom: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero__reveal,
    .hero__glow,
    .btn-glow::after {
        animation: none !important;
    }

    .hero {
        transform: none !important;
    }

    .hero__glow,
    .hero__mesh {
        transform: none !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .scroll-progress__bar,
    .back-to-top,
    .section-rail__dot,
    .section-rail__label,
    .card:not(.demo-card),
    .tag-list li,
    .main-header {
        transition: none !important;
    }
}
