@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/outfit/v15/QGYvz_MVcBeNP4NJtEtq.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD
}

body {
    font-family: 'Outfit', sans-serif;
    scroll-behavior: smooth;
    color: #4B5563;
    -webkit-font-smoothing: antialiased
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 900;
    color: #0A192F;
    letter-spacing: -.05em;
    line-height: 1
}

#perche {
    scroll-margin-top: 140px;
}

#contatti {
    scroll-margin-top: 135px;
}

.text-gradient {
    background: linear-gradient(135deg, #FF416A 0%, #FF7693 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 0.05em;
}

.btn-primary {
    background-color: #FF416A;
    color: #FFF;
    transition: all .4s cubic-bezier(.175, .885, .32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900
}

.btn-primary:hover {
    background-color: #E02E55;
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(255, 65, 106, .4)
}

.section-tag {
    display: inline-block;
    padding: .5rem 1.25rem;
    background: rgba(255, 65, 106, .1);
    border-radius: 9999px;
    color: #FF416A;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .15em;
    margin-bottom: 1.5rem
}

@keyframes bounce-soft {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(6px);
    }
}

.scroll-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #94a3b8;
    animation: bounce-soft 2s ease-in-out infinite;
    margin-top: 1.5rem;
}

#nav-cta {
    letter-spacing: 0.12em !important;
    font-size: 13px !important;
    font-weight: 950 !important;
    animation: none !important;
}

@media (min-width: 768px) {
    #nav-cta {
        font-size: 15px !important;
    }
}

@keyframes click-me-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.97);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ripple-effect {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(3.5);
        opacity: 0;
    }
}

.animate-click-me {
    position: relative;
    overflow: hidden;
    animation: click-me-pulse 2s ease-in-out infinite;
}

.animate-click-me::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    pointer-events: none;
    animation: ripple-effect 2s ease-out infinite;
}

.submit-subtext {
    font-size: 11px;
    font-weight: 900;
    color: #FF416A;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.hero-section-dynamic {
    min-height: calc(100vh - 80px);
    /* 80px approx nav height */
    /* Fallback for browsers that don't support svh/dvh */
    min-height: calc(100svh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

@media (max-height: 800px) {
    .hero-section-dynamic h1 {
        font-size: clamp(2.5rem, 10vh, 4.2rem) !important;
        margin-bottom: 1rem !important;
    }

    .hero-section-dynamic p {
        font-size: clamp(0.9rem, 2.2vh, 1.1rem) !important;
        margin-bottom: 1.5rem !important;
    }

    .hero-section-dynamic .btn-primary {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
}

/* Height-aware responsiveness to keep CTA above the fold*/
@media (max-width: 768px) {
    .hero-section-dynamic {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-bottom: 20vh !important;
        /* Shifts visual center upwards */
    }

    .hero-section-dynamic h1 {
        font-size: 9.5vw !important;
        /* Calculated to fit 13 chars on 320px screen */
        line-height: 1.1 !important;
        margin-bottom: 1rem !important;
        letter-spacing: -0.03em !important;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-section-dynamic p {
        font-size: clamp(0.9rem, 4.5vw, 1.15rem) !important;
        margin-bottom: 2rem !important;
        line-height: 1.4 !important;
        width: 100% !important;
        max-width: 320px !important;
        /* Constraint width for readability */
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .hero-section-dynamic .btn-primary {
        padding: 1.25rem 3.5rem !important;
        /* Much more breathing room */
        font-size: 0.85rem !important;
        /* Slightly smaller for better fit */
        width: auto !important;
        max-width: 85% !important;
        white-space: nowrap !important;
        letter-spacing: 0.05em;
    }
}

@media (max-width: 600px) {
    .hero-section-dynamic {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-bottom: 25vh !important;
        /* Even more lift on small screens */
    }

    .hero-section-dynamic h1 {
        font-size: 11vw !important;
        line-height: 1.05 !important;
        margin-bottom: 0.8rem !important;
    }

    .hero-section-dynamic p {
        font-size: 4vw !important;
        max-width: 90% !important;
        line-height: 1.35 !important;
    }

    .hero-section-dynamic .btn-primary {
        padding: 1.5rem 2.5rem !important;
        /* Huge padding for capsule look */
        font-size: 3.5vw !important;
        /* Fluid font size to fit padding */
        max-width: 90% !important;
        white-space: nowrap !important;
        letter-spacing: 0.05em !important;
    }
}

@media (max-height: 650px) {
    .hero-section-dynamic h1 {
        font-size: clamp(2rem, 9vh, 3.5rem) !important;
    }

    .hero-section-dynamic p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 1.2rem !important;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all .8s ease-out
}

.reveal.active {
    opacity: 1;
    transform: translateY(0)
}

.fixed-cta {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    margin: 0 !important;
    background: #FF416A !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem 3.5rem !important;
    color: white !important;
    font-weight: 950 !important;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 15px !important;
    border-radius: 2rem !important;
    box-shadow: none !important;
    transition: all .5s cubic-bezier(.23, 1, .32, 1);
    white-space: nowrap;
    animation: none !important;
}

@keyframes button-float-wavy {

    0%,
    100% {
        border-top-left-radius: 60px;
        border-top-right-radius: 30px;
        transform: translateX(-50%) translateY(0);
    }

    33% {
        border-top-left-radius: 40px;
        border-top-right-radius: 60px;
        transform: translateX(-50%) translateY(-3px);
    }

    66% {
        border-top-left-radius: 70px;
        border-top-right-radius: 40px;
        transform: translateX(-50%) translateY(0);
    }
}

.fixed-cta i {
    color: white !important;
    font-size: 1.2em;
}

.fixed-cta:hover {
    filter: brightness(1.1);
    transform: translateX(-50%) translateY(-3px);
}

.cta-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(100px) !important;
    pointer-events: none
}

@media (max-width:640px) {
    .fixed-cta {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
        transform: none !important;
        width: calc(100% - 2rem) !important;
        border-radius: 1.5rem !important;
        border: none !important;
        padding: 1.1rem 1rem !important;
        /* Font fluido: si rimpicciolisce su schermi molto piccoli */
        font-size: clamp(11px, 3.8vw, 14px) !important;
        /* Riduzione tracking per compattezza */
        letter-spacing: 0.05em !important;
        white-space: normal !important;
        text-align: center;
        line-height: 1.2;
    }

    /* Hero Mobile Overrides */
    section.min-h-screen {
        padding-top: 120px !important;
        padding-bottom: 2rem !important;
        min-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    h1 {
        font-size: clamp(1.1rem, 8.5vw, 3.5rem) !important;
        margin-top: 0 !important;
    }

    #hero-cta {
        padding: 1.5rem 2.5rem !important;
        font-size: 3.5vw !important;
        width: 100% !important;
        max-width: 290px !important;
        margin-top: 1rem !important;
    }

    .cta-hidden {
        transform: translateY(100%) !important;
    }
}

#toast-notification {
    position: fixed;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    transition: all .7s cubic-bezier(.19, 1, .22, 1);
    width: fit-content
}

#toast-notification.active {
    top: 100px
}

#toast-notification.active .toast-container {
    animation: toast-pulse-red 2s infinite
}

@keyframes toast-pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 65, 106, .8), 0 20px 40px rgba(0, 0, 0, .4)
    }

    50% {
        box-shadow: 0 0 30px 10px rgba(255, 65, 106, .4), 0 20px 40px rgba(0, 0, 0, .4)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 65, 106, .8), 0 20px 40px rgba(0, 0, 0, .4)
    }
}

.pulse-green {
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .7);
    animation: pulse-green 2s infinite
}

@keyframes star-flicker {

    0%,
    100% {
        opacity: .8;
        transform: scale(1)
    }

    50% {
        opacity: .1;
        transform: scale(.4)
    }
}

.star-animated {
    animation: star-flicker 3s infinite ease-in-out;
    filter: blur(.2px)
}

.star-yellow {
    color: #FFD700
}

.star-pink {
    color: #FF416A
}

.star-blue {
    color: #1A365D
}

@media (max-width:640px) {
    #toast-notification {
        width: calc(100% - 2rem)
    }
}

/* Success View Animations */
@keyframes sims-diamond-spin {
    0% {
        transform: perspective(1000px) rotateY(0deg) scale(1);
        filter: brightness(1);
    }

    50% {
        transform: perspective(1000px) rotateY(180deg) scale(1.1);
        filter: brightness(1.3);
    }

    100% {
        transform: perspective(1000px) rotateY(360deg) scale(1);
        filter: brightness(1);
    }
}

.animate-sims-diamond {
    animation: sims-diamond-spin 3s linear infinite;
    transform-style: preserve-3d;
}

/* Global Cookie Rain & Accumulation */
.cookie-crumb,
.cookie-whole {
    position: absolute;
    pointer-events: none;
    z-index: 19001;
}

.cookie-crumb {
    background: #D2691E;
    border-radius: 50%;
    box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.3);
}

.cookie-whole {
    color: #D2691E;
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.falling {
    animation: fall-global linear forwards;
}

@keyframes fall-global {
    from {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateY(calc(100vh + 50px)) rotate(720deg);
        opacity: 0;
    }
}

.mound-piece {
    position: absolute;
    top: 0;
    transform-origin: center top;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mound-piece::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background: rgba(60, 30, 10, 0.6);
    border-radius: 50%;
    top: var(--chip-top, 20%);
    left: var(--chip-left, 20%);
    filter: blur(0.5px);
}

/* --- REACTIVE UI HARMONY --- */
/* Magnetic Elevator: Solleva il widget cookie quando la CTA è visibile su mobile */
#cookie-widget {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@media (max-width: 640px) {
    #floating-cta:not(.cta-hidden)~#cookie-widget {
        bottom: 5.8rem !important;
        transform: scale(0.9) !important;
        opacity: 0.85;
    }

    #floating-cta:not(.cta-hidden)~#cookie-widget:hover {
        opacity: 1;
        transform: scale(1) !important;
    }

    /* Sposta anche il debug pill se attivo */
    #floating-cta:not(.cta-hidden)~#ui-debug-pill {
        bottom: 10rem !important;
    }
}

@keyframes liquid-bubble {
    0% {
        border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
        transform: scale(1);
    }

    25% {
        border-radius: 70% 30% 46% 54% / 30% 29% 71% 70%;
        transform: scale(1.05) rotate(2deg);
    }

    50% {
        border-radius: 37% 63% 51% 49% / 61% 35% 65% 39%;
        transform: scale(0.95) rotate(-2deg);
    }

    75% {
        border-radius: 84% 16% 15% 85% / 55% 79% 21% 45%;
        transform: scale(1.05) rotate(1deg);
    }

    100% {
        border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
        transform: scale(1);
    }
}

.animate-liquid {
    animation: liquid-bubble 6s ease-in-out infinite;
    background: linear-gradient(135deg, #FF416A 0%, #FF7693 100%);
}

/* Hide Scrollbars */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Marquee Animation */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.animate-marquee {
    display: flex;
    width: max-content;
    animation: marquee 80s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px border rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}