/* ============================================
   I GUARDIANI DEL DESIGN - Stili Custom
   ============================================ */

/* Base html per smooth scroll nativo (backup) */
html {
    scroll-behavior: auto; /* gestito da Lenis */
}

html.lenis {
    height: auto;
}



/* Loader overlay - etereo */
#page-loader {
    pointer-events: none;
    background: #0A0A0F;
}

/* Barre del loader con effetto etereo */
.loader-bar {
    position: relative;
    background: linear-gradient(to top, rgba(255,255,255,0.0) 0%, var(--bar-color, #fff) 40%, var(--bar-color, #fff) 100%);
    filter: blur(0px);
    opacity: 0.85;
    box-shadow: 0 0 20px var(--bar-color, transparent), 0 0 60px var(--bar-color, transparent);
}

/* Colore etereo per ogni barra */
.loader-bar:nth-child(1) { --bar-color: #C0392B; }
.loader-bar:nth-child(2) { --bar-color: #E67E22; }
.loader-bar:nth-child(3) { --bar-color: #F1C40F; }
.loader-bar:nth-child(4) { --bar-color: #2980B9; }
.loader-bar:nth-child(5) { --bar-color: #8E44AD; }

/* Gradient text utility */
.text-gradient-rainbow {
    background: linear-gradient(90deg, #C0392B, #E67E22, #F1C40F, #2980B9, #8E44AD);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ——— STAR LAYOUT ——— */
.star-layout {
    min-height: 1050px;
    position: relative;
}

/* Center logo */

.star-logo-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 0 50px rgba(255,255,255,0.12);
    overflow: hidden;
}
.star-logo-circle img {
    transform: scale(1.1);
}
.star-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.02em;
}

/* ——— CARD WRAPPER (star) ——— */
.card-wrapper {
    position: absolute;
    z-index: 3;
    perspective: 1000px;
    cursor: pointer;
    width: 180px;
}
.card-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-wrapper.flipped .card-inner {
    transform: rotateY(180deg);
}
.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.card-back {
    transform: rotateY(180deg);
}
.card-image-wrap {
    width: 180px;
    aspect-ratio: 9 / 16;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(10,10,15,0.5);
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.4s ease;
}
.card-wrapper:hover .card-image-wrap {
    box-shadow: 0 0 30px rgba(255,255,255,0.1) !important;
}
.card-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.75rem;
    line-height: 1;
    margin-top: 10px;
}
.card-type {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid;
    margin-top: 4px;
    white-space: nowrap;
    font-weight: 600;
}

/* Card-inner height for flip */
.card-inner {
    height: 360px;
}

/* ——— GEOMETRIC STAR POSITIONS ——— */
.star-layout {
    width: 1200px;
    height: 1050px;
    margin: 0 auto;
    position: relative;
}

/* Center logo — true center of the 1200×1050 container */
.star-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
}

/* Card positions — wider pentagon vertices around center (600,475) */
.card-at-genny { left: 90px; top: 475px; transform: translate(-50%, -50%); }
.card-at-mani  { left: 230px; top: 900px; transform: translate(-50%, -50%); }
.card-at-proji { left: 600px; top: 50px; transform: translate(-50%, -50%); }
.card-at-magen { left: 1110px; top: 475px; transform: translate(-50%, -50%); }
.card-at-refli { left: 970px; top: 900px; transform: translate(-50%, -50%); }

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .star-layout { width: 760px; height: 680px; }
    .star-logo-circle { width: 130px; height: 130px; }
    .star-title { font-size: 2.25rem; }
    .card-wrapper { width: 140px; }
    .card-image-wrap { width: 140px; }
    .card-inner { height: 280px; }
    .card-name { font-size: 1.4rem; }
    .card-type { font-size: 0.7rem; }
    /* Scale positions proportionally */
    .card-at-genny { left: 75px; top: 340px; }
    .card-at-mani  { left: 190px; top: 590px; }
    .card-at-proji { left: 380px; top: 70px; }
    .card-at-magen { left: 685px; top: 340px; }
    .card-at-refli { left: 570px; top: 590px; }
}

/* ——— LIGHTNING SPRITE OVERLAY ——— */
.lightning-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}
.lightning-sprite {
    position: absolute;
    left: 450px;
    top: 318px; /* 350 - 32 */
    height: 64px;
    background-image: url('Assets/lightning/shock.png');
    background-size: 400% 100%;
    background-position: 0% 0%;
    background-repeat: no-repeat;
    transform-origin: 0% 50%;
    opacity: 0;
    pointer-events: none;
    image-rendering: pixelated;
    mix-blend-mode: screen;
}
.lightning-sprite.active {
    opacity: 1;
    animation: lightningSprite 0.4s steps(4) infinite;
}
@keyframes lightningSprite {
    from { background-position-x: 0%; }
    to   { background-position-x: 100%; }
}

/* ——— MOBILE CHARACTER CARDS ——— */
.character-card {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.character-card .video-player {
    pointer-events: none;
}
.character-card.video-active .character-card-img {
    opacity: 0;
}
.character-card.video-active .video-player {
    opacity: 1;
}

/* ——— Parallax container ——— */
.parallax-img {
    will-change: transform;
}

/* Quiz option hover state */
.quiz-option {
    transition: all 0.3s ease;
}
.quiz-option:hover {
    transform: translateX(8px);
}

/* Footer social icons */
.social-icon {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Responsive aspect ratio per hero su mobile */
@media (max-width: 640px) {
    #hero {
        min-height: 100svh;
    }
}

/* Fix per immagini PNG che non si caricano subito */
img {
    max-width: 100%;
    height: auto;
}



/* Accessibilità: riduci motion se l'utente lo preferisce */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Stili per il reveal del calcolo */
#real-result,
#quiz-result-presumed {
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Canvas stili base */
canvas {
    display: block;
}

/* Focus-visible for all interactive elements */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Gradient arcobaleno footer con i 5 colori Guardiani */
.footer-rainbow {
    background: linear-gradient(90deg, #C0392B, #E67E22, #F1C40F, #2980B9, #8E44AD);
}

/* Freccia scroll orizzontale prodotti */
@keyframes bounceX {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(6px);
    }
}

.animate-bounce-x {
    animation: bounceX 1.4s infinite ease-in-out;
}

/* ============================================
   FILTER TABS — PILL MENU
   ============================================ */
.filter-tabs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
@media (max-width: 640px) {
    .filter-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0.25rem 0.25rem 0.75rem;
        -webkit-overflow-scrolling: touch;
    }
    .filter-tabs::-webkit-scrollbar { display: none; }
}
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.35rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1.5px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
    min-height: 44px;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}
@media (max-width: 640px) {
    .filter-tab {
        scroll-snap-align: start;
        flex-shrink: 0;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}
.filter-tab:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 0 20px rgba(255,255,255,0.08);
}
.filter-tab.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 24px rgba(255,255,255,0.12);
}
/* Colored dot indicator */
.filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255,255,255,0.5);
    transition: all 0.25s ease;
}
.filter-tab.active .filter-dot {
    box-shadow: 0 0 10px currentColor;
}
/* Character colors on active */
.filter-tab[data-filter="genny"].active { color: #E67E22; border-color: #E67E22; background: rgba(230,126,34,0.12); }
.filter-tab[data-filter="genny"].active .filter-dot { background: #E67E22; }
.filter-tab[data-filter="mani"].active { color: #C0392B; border-color: #C0392B; background: rgba(192,57,43,0.12); }
.filter-tab[data-filter="mani"].active .filter-dot { background: #C0392B; }
.filter-tab[data-filter="proji"].active { color: #2980B9; border-color: #2980B9; background: rgba(41,128,185,0.12); }
.filter-tab[data-filter="proji"].active .filter-dot { background: #2980B9; }
.filter-tab[data-filter="magen"].active { color: #F1C40F; border-color: #F1C40F; background: rgba(241,196,15,0.12); }
.filter-tab[data-filter="magen"].active .filter-dot { background: #F1C40F; }
.filter-tab[data-filter="refli"].active { color: #8E44AD; border-color: #8E44AD; background: rgba(142,68,173,0.12); }
.filter-tab[data-filter="refli"].active .filter-dot { background: #8E44AD; }
/* "Tutti" active = white */
.filter-tab[data-filter="all"].active { color: #fff; border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.12); }
.filter-tab[data-filter="all"].active .filter-dot { background: #fff; }

/* ============================================
   CAROUSEL — SCROLL-SNAP (unificato desktop/mobile)
   ============================================ */
.carousel-wrapper {
    position: relative;
    padding: 0 1rem;
}
@media (min-width: 768px) {
    .carousel-wrapper { padding: 0 4rem; }
}

.carousel-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 1rem 0 2rem;
    list-style: none;
    margin: 0;
}
.carousel-scroll::-webkit-scrollbar { display: none; }

.carousel-scroll > li {
    flex-shrink: 0;
    display: block;
}

/* Nav arrows — desktop only, always visible */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
@media (min-width: 768px) {
    .carousel-arrow { display: flex; }
}
@media (max-width: 767px) {
    .carousel-arrow { display: none; }
}
.carousel-arrow:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-50%) scale(1.1);
}
.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}
.carousel-arrow-left  { left: 0.5rem; }
.carousel-arrow-right { right: 0.5rem; }
@media (min-width: 768px) {
    .carousel-arrow-left  { left: 1rem; }
    .carousel-arrow-right { right: 1rem; }
}
.carousel-arrow svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.product-card {
    display: flex;
    flex-direction: column;
    width: 280px;
    min-height: 460px;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: transform 0.5s, box-shadow 0.5s, border-color 0.5s;
    will-change: transform;
}
@media (min-width: 768px) {
    .product-card { width: 320px; }
}
@media (min-width: 1280px) {
    .product-card { width: 340px; }
}
.product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.15);
}

.product-card-img {
    aspect-ratio: 1;
    min-height: 232px;
    border-radius: 1rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2rem;
    transition: transform 0.5s;
}
.product-card:hover .product-card-img img {
    transform: scale(1.1);
}

.product-card-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}
.product-card-sub {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.product-card-btn {
    display: block;
    text-align: center;
    width: 100%;
    padding: 0.75rem 0;
    border-radius: 9999px;
    font-weight: 600;
    border: 1px solid;
}
.product-card-btn-genny { background: rgba(230,126,34,0.2);  color: #E67E22; border-color: rgba(230,126,34,0.3); }
.product-card-btn-mani  { background: rgba(192,57,43,0.2);   color: #C0392B; border-color: rgba(192,57,43,0.3); }
.product-card-btn-proji { background: rgba(41,128,185,0.2);  color: #2980B9; border-color: rgba(41,128,185,0.3); }
.product-card-btn-magen { background: rgba(241,196,15,0.2);  color: #F1C40F; border-color: rgba(241,196,15,0.3); }
.product-card-btn-refli { background: rgba(142,68,173,0.2);  color: #8E44AD; border-color: rgba(142,68,173,0.3); }

/* Filtered-out cards */
.product-card.is-hidden,
li:has(.product-card.is-hidden) {
    display: none;
}