/* =====================================================================
 *  Landing — animazioni ed effetti (rispetta prefers-reduced-motion)
 * ===================================================================== */

/* Scroll reveal base */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--reveal-i, 0) * 0.08s);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dot grid background */
.landing-grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
    background-image: radial-gradient(rgba(10, 10, 12, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    animation: grid-drift 40s linear infinite;
}

@keyframes grid-drift {
    0% { background-position: 0 0; }
    100% { background-position: 28px 28px; }
}

/* Floating orbs */
.landing-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.landing-orb--1 {
    width: min(320px, 50vw);
    height: min(320px, 50vw);
    top: 8%;
    right: 5%;
    background: rgba(199, 154, 48, 0.35);
    animation: orb-float-1 14s ease-in-out infinite;
}

.landing-orb--2 {
    width: min(240px, 40vw);
    height: min(240px, 40vw);
    bottom: 25%;
    left: -5%;
    background: rgba(199, 154, 48, 0.15);
    animation: orb-float-2 18s ease-in-out infinite;
}

.landing-orb--3 {
    width: 120px;
    height: 120px;
    top: 45%;
    left: 40%;
    background: rgba(10, 10, 12, 0.08);
    animation: orb-float-3 11s ease-in-out infinite;
}

@keyframes orb-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-24px, 20px) scale(1.05); }
    66% { transform: translate(16px, -12px) scale(0.95); }
}

@keyframes orb-float-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -24px); }
}

@keyframes orb-float-3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 16px); }
}

.landing-glow {
    animation: glow-pulse 8s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}

/* Marquee */
.landing-marquee {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 10px 0;
    border-block: 1px solid rgba(199, 154, 48, 0.12);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
}

.landing-marquee-track {
    display: flex;
    gap: 48px;
    width: max-content;
    animation: marquee 28s linear infinite;
}

.landing-marquee-track span {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-500);
    white-space: nowrap;
}

.landing-marquee-track span::after {
    content: '◆';
    margin-left: 48px;
    color: var(--gold-500);
    font-size: 0.5rem;
    vertical-align: middle;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Header on scroll */
.landing-top.is-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 4px 24px rgba(10, 10, 12, 0.08);
}

.brand-logo-float {
    animation: logo-glow 4s ease-in-out infinite;
}

@keyframes logo-glow {
    0%, 100% { filter: drop-shadow(0 2px 8px rgba(199, 154, 48, 0.4)); }
    50% { filter: drop-shadow(0 4px 16px rgba(199, 154, 48, 0.65)); }
}

/* Kicker live dot */
.kicker-live {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2f8a4d;
    margin-right: 8px;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(47, 138, 77, 0.5);
    animation: live-ping 2s ease-out infinite;
}

@keyframes live-ping {
    0% { box-shadow: 0 0 0 0 rgba(47, 138, 77, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(47, 138, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 138, 77, 0); }
}

/* Animated gradient text */
.text-gradient--animated {
    background-size: 200% auto;
    animation: gradient-flow 5s linear infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Shimmer button */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.45),
        transparent
    );
    animation: shimmer 3.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    40%, 100% { left: 150%; }
}

.btn-arrow {
    width: 18px;
    height: 18px;
    margin-left: 6px;
    transition: transform 0.25s ease;
}

.btn-shimmer:hover .btn-arrow {
    transform: translateX(4px);
}

.dot--pulse {
    animation: dot-blink 2s ease-in-out infinite;
}

@keyframes dot-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Preview card float */
.preview-stack--float {
    animation: card-hover 6s ease-in-out infinite;
}

@keyframes card-hover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.preview-card--back {
    animation: card-back-tilt 6s ease-in-out infinite;
}

@keyframes card-back-tilt {
    0%, 100% { transform: rotate(3deg); }
    50% { transform: rotate(5deg) translateY(4px); }
}

.preview-card--main {
    overflow: hidden;
}

.preview-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.06) 45%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 55%,
        transparent 60%
    );
    transform: translateX(-100%);
    animation: card-shine 5s ease-in-out infinite;
}

@keyframes card-shine {
    0%, 70%, 100% { transform: translateX(-100%); }
    85% { transform: translateX(100%); }
}

.pill--glow {
    box-shadow: 0 0 20px rgba(199, 154, 48, 0.35);
}

.preview-stat--slide {
    opacity: 0;
    transform: translateX(-12px);
    transition:
        opacity 0.5s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(0.4s + var(--i, 0) * 0.15s);
}

.landing-hero-visual.is-animated .preview-stat--slide {
    opacity: 1;
    transform: translateX(0);
}

.preview-bar span {
    width: 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.6s;
}

.landing-hero-visual.is-animated .preview-bar span {
    width: var(--target, 72%);
}

.live-badge {
    position: relative;
    padding: 2px 10px;
    border-radius: 99px;
    background: rgba(47, 138, 77, 0.2);
    font-size: 0.8rem !important;
    animation: live-glow 2s ease-in-out infinite;
}

@keyframes live-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(47, 138, 77, 0); }
    50% { box-shadow: 0 0 12px rgba(47, 138, 77, 0.4); }
}

.preview-float-badge {
    position: absolute;
    right: -8px;
    bottom: 24px;
    padding: 8px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--gold-300);
    background: var(--ink-900);
    border: 1px solid rgba(199, 154, 48, 0.4);
    border-radius: 99px;
    box-shadow: var(--shadow-card);
    animation: badge-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1s both,
        badge-float 4s ease-in-out 1.6s infinite;
}

@keyframes badge-pop {
    from {
        opacity: 0;
        transform: scale(0.6) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes badge-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Scroll hint */
.landing-scroll-hint {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: -8px auto 32px;
    color: var(--ink-500);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.landing-scroll-hint svg {
    width: 24px;
    height: 24px;
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

.landing-scroll-hint:hover {
    color: var(--gold-600);
}

/* Feature icon pop on visible */
.feature-icon--pop {
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feature-card.is-visible .feature-icon--pop {
    transform: scale(1);
}

.feature-card.is-visible {
    transition-delay: calc(var(--reveal-i, 0) * 0.1s);
}

.feature-card.is-visible:hover .feature-icon--pop {
    transform: scale(1.08) rotate(-3deg);
}

/* CTA band glow */
.landing-cta-band--glow {
    position: relative;
    overflow: hidden;
}

.landing-cta-band--glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(199, 154, 48, 0.6),
        transparent,
        rgba(199, 154, 48, 0.4),
        transparent
    );
    background-size: 300% 100%;
    animation: border-run 6s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    border-radius: var(--radius-lg);
}

@keyframes border-run {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.cta-band-inner {
    position: relative;
    z-index: 1;
}

/* Layering */
.landing--v5 > *:not(.landing-grid-bg):not(.landing-orb):not(.landing-glow) {
    position: relative;
    z-index: 1;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .landing-marquee-track,
    .landing-orb,
    .landing-glow,
    .landing-grid-bg,
    .preview-stack--float,
    .preview-card--back,
    .preview-shine,
    .brand-logo-float,
    .text-gradient--animated,
    .btn-shimmer::after,
    .landing-scroll-hint svg,
    .kicker-live,
    .preview-float-badge,
    .landing-cta-band--glow::before {
        animation: none !important;
    }

    .preview-stat--slide {
        opacity: 1;
        transform: none;
    }

    .preview-bar span {
        width: var(--target, 72%) !important;
        transition: none;
    }
}
