/* ============================================================
   BASE.CSS — Reset, font-face, root variables
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: var(--font-primary);
    color: var(--color-text);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* Scrollbar styling per aree di contenuto */
.scrollable {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) transparent;
}

.scrollable::-webkit-scrollbar {
    width: 4px;
}

.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 2px;
}

/* Splash screen */
#splash {
    position: fixed;
    inset: 0;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease;
}

#splash.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.splash-logo {
    width: min(40vw, 300px);
}

.splash-bar {
    width: min(40vw, 300px);
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.splash-progress {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    animation: splash-load 1.2s ease forwards;
}

@keyframes splash-load {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Attract overlay */
#attract-overlay {
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    z-index: 100;
    cursor: pointer;
    overflow: hidden;
}

/* Particelle di sfondo attract */
#attract-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 102, 0, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 51, 153, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 50% 10%, rgba(0, 135, 60, 0.12) 0%, transparent 40%);
    animation: attract-bg 8s ease-in-out infinite alternate;
}

@keyframes attract-bg {
    0% {
        transform: scale(1) rotate(0deg);
    }
    100% {
        transform: scale(1.15) rotate(3deg);
    }
}

#attract-overlay .attract-logo {
    width: min(38%, 380px);
    position: relative;
    animation: attract-float 3s ease-in-out infinite;
}

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

.attract-cta {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: #fff;
    text-align: center;
    position: relative;
    animation: attract-cta-pulse 1.8s ease-in-out infinite;
}

.attract-sub {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    position: relative;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@keyframes attract-cta-pulse {
    0%, 100% {
        opacity: 0.75;
    }
    50% {
        opacity: 1;
    }
}

/* Ring animato attorno al logo */
.attract-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 102, 0, 0.3);
    animation: attract-ring-expand 3s ease-out infinite;
}

.attract-ring:nth-child(2) {
    animation-delay: 1s;
}

.attract-ring:nth-child(3) {
    animation-delay: 2s;
}

@keyframes attract-ring-expand {
    0% {
        width: 12%;
        height: 12%;
        opacity: 0.8;
    }
    100% {
        width: 80%;
        height: 80%;
        opacity: 0;
    }
}

input,
textarea,
select,
button {
    -webkit-appearance: none; /* Chrome, Safari, Opera, Edge */
    -moz-appearance: none; /* Firefox */
    appearance: none; /* Standard */

    /* Rimuove i bordi predefiniti */
    border: none;

    /* Rimuove lo sfondo predefinito */
    background: transparent;

    /* Rimuove padding e margini nativi */
    padding: 0;
    margin: 0;

    /* Resetta il font per ereditarlo dal contenitore */
    font-family: inherit;
    font-size: inherit;
}

input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: none;
    box-shadow: none;
}