:root {
    --color-bg: #ffffff;
    --color-text-main: #0B4A5D;
    --color-text-light: #4A6E7A;
    --color-accent: #5CAFB3;
    --color-accent-light: #F0F8F8;
    --color-warm: #FCAE28;
    
    --font-primary: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --transition-smooth: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    --border-radius-lg: 24px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;

    --header-height-desktop: 90px;
    --header-height-mobile: 70px;
    --header-height: var(--header-height-desktop);
}

@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-weight: 500; line-height: 1.2; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }

/* -- SITE HEADER (Fissa) -- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, border-bottom 0.4s ease;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border-bottom: 1px solid rgba(11, 74, 93, 0);
}

.site-header.is-active {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(11, 74, 93, 0.08);
}

.site-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 1rem;
}

.logo-target {
    width: 240px; /* Larghezza massima consentita */
    height: 76px; /* Altezza massima consentita (in header da 90px) */
}
@media (max-width: 768px) {
    .logo-target {
        width: 200px; 
        height: 56px; /* In header da 70px */
    }
}

.header-wave-banner {
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-text-main) 100%);
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.site-header.is-active .header-wave-banner {
    opacity: 1;
    transform: translateY(0);
}

/* -- LOGO ANIMATO (Fixed) -- */
.fixed-logo-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 100%;
    max-width: 440px; /* Dimensione di partenza enorme */
    z-index: 1001; /* Sopra la header */
    opacity: 0;
    will-change: transform, opacity;
}

@media (max-width: 768px) {
    .fixed-logo-wrapper {
        max-width: 320px;
    }
}

body.intro-complete .fixed-logo-wrapper {
    opacity: 1;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Rimuoviamo la transizione CSS quando entra in gioco lo scroll */
body.intro-complete.scroll-active .fixed-logo-wrapper {
    transition: none;
}

/* -- HERO SCROLL TRACK -- */
.hero-scroll-track {
    position: relative;
    width: 100%;
    height: 180vh; /* scrollable space ridotto (prima era 250vh) */
    z-index: 10;
}

@media (max-width: 768px) {
    .hero-scroll-track {
        height: 160vh;
    }
}

.hero-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
}

.hero-logo {
    width: 100%;
    height: auto;
    display: block;
}

.logo-glow {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(252,174,40,0.15) 0%, rgba(252,174,40,0) 70%);
    opacity: 0;
    transition: opacity 1.5s ease 0.5s;
    z-index: -1;
    pointer-events: none;
}

body.intro-complete .logo-glow { opacity: 1; }

.hero-sequence-container {
    position: relative;
    z-index: 4;
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 0 1.5rem;
    margin-top: 15vh; /* Push down to make room for logo at top */
}

.seq-item {
    opacity: 0;
    transform: translateY(20px);
    will-change: opacity, transform;
}

.hero-title {
    font-size: 2.8rem;
    letter-spacing: 2px;
    color: var(--color-text-main);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    letter-spacing: 3px;
    color: var(--color-text-light);
    margin-bottom: 3.5rem;
}

.coming-title {
    font-size: 2.5rem;
    color: var(--color-text-main);
    margin-bottom: 1rem;
    font-weight: 400;
}

.coming-desc {
    font-size: 1.15rem;
    color: var(--color-text-light);
    max-width: 650px;
    margin: 0 auto 3rem auto;
    line-height: 1.7;
}

.instagram-cta {
    display: inline-block;
}

.btn-instagram {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--color-accent);
    color: var(--color-bg);
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.125rem;
    font-weight: 500;
    transition: transform var(--transition-smooth), background-color var(--transition-smooth), box-shadow var(--transition-smooth);
    box-shadow: 0 8px 20px rgba(92, 175, 179, 0.25);
}

.btn-arrow { transition: transform var(--transition-smooth); display: inline-block; }

.btn-instagram:hover, .btn-instagram:focus-visible {
    transform: translateY(-3px);
    background-color: #4A9C9F;
    box-shadow: 0 12px 25px rgba(92, 175, 179, 0.35);
}

.btn-instagram:hover .btn-arrow, .btn-instagram:focus-visible .btn-arrow {
    transform: translateX(4px);
}

.ig-handle {
    margin-top: 1rem;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* Reduced Motion Fallback */
body.reduced-motion-active .hero-scroll-track { height: auto; padding: 6rem 0; }
body.reduced-motion-active .hero-sticky { position: relative; height: auto; flex-direction: column; }
body.reduced-motion-active .logo-wrapper { position: relative; transform: none !important; margin-bottom: 2rem; max-width: 150px; top: 0; left: 0; }
body.reduced-motion-active .hero-sequence-container { margin-top: 0; }

/* -- VALUES SECTION -- */
.values {
    width: 100%;
    max-width: 1200px;
    padding: 4rem 1.5rem;
    margin: 0 auto 4rem auto;
    text-align: center;
}

.values-header { margin-bottom: 5rem; }
.values-subtitle { font-size: 0.9rem; letter-spacing: 2px; color: var(--color-accent); margin-bottom: 1rem; font-weight: 600; text-transform: uppercase; }
.values-title { font-size: 2.5rem; color: var(--color-text-main); margin-bottom: 1rem; }
.values-desc { font-size: 1.1rem; color: var(--color-text-light); }

.values-wave-container { position: relative; width: 100%; }

.values-wave-line {
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: -1;
    stroke-dashoffset: 1200; /* For animation */
    transition: stroke-dashoffset 2s ease;
}

.values-wave-line.is-visible { stroke-dashoffset: 0; }

.values-grid {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.value-item {
    flex: 1;
    background: var(--color-bg);
    padding: 1rem;
    opacity: 0;
    transform: translateY(20px) scale(0.92);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.values-grid.is-visible .value-item { opacity: 1; transform: translateY(0) scale(1); }
.values-grid.is-visible .val-seq-1 { transition-delay: 0.1s; }
.values-grid.is-visible .val-seq-2 { transition-delay: 0.2s; }
.values-grid.is-visible .val-seq-3 { transition-delay: 0.3s; }
.values-grid.is-visible .val-seq-4 { transition-delay: 0.4s; }
.values-grid.is-visible .val-seq-5 { transition-delay: 0.5s; }

.value-icon { color: var(--color-accent); margin-bottom: 1rem; transition: transform var(--transition-smooth); }
.value-item:hover .value-icon { transform: translateY(-5px); }
.value-item h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: 0.5px; }
.value-item p { font-size: 0.9rem; color: var(--color-text-light); }


/* -- DONATIONS SECTION -- */
.donations-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 0 1.5rem;
    margin: 0 auto 6rem auto;
}

.donations-box {
    background-color: var(--color-accent-light);
    border-radius: var(--border-radius-lg);
    padding: 5rem 4rem;
    display: flex;
    gap: 6rem;
    align-items: center;
}

.don-left { flex: 1; display: flex; flex-direction: column; }
.don-main-title { font-size: 1rem; letter-spacing: 2px; color: var(--color-accent); font-weight: 600; margin-bottom: 1rem; }
.don-main-title span { display: block; font-size: 2.8rem; color: var(--color-text-main); font-weight: 500; letter-spacing: 0; line-height: 1.1; margin-top: 0.5rem; }

.don-left p { color: var(--color-text-light); font-size: 1.1rem; margin-bottom: 3rem; line-height: 1.7; }
.grazie-text { font-family: 'Brush Script MT', cursive, "Comic Sans MS", sans-serif; font-size: 3.5rem; color: var(--color-text-main); opacity: 0.8; transform: rotate(-5deg); transform-origin: left center;}

.don-right { flex: 1; display: flex; flex-direction: column; }

.bank-details { display: flex; flex-direction: column; gap: 1rem; }
.bank-row {
    background: var(--color-bg);
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 15px rgba(11, 74, 93, 0.03);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.bank-details.is-visible .bank-row { opacity: 1; transform: translateY(0); }
.bank-details.is-visible .don-seq-1 { transition-delay: 0.1s; }
.bank-details.is-visible .don-seq-2 { transition-delay: 0.2s; }
.bank-details.is-visible .don-seq-3 { transition-delay: 0.3s; }
.bank-details.is-visible .don-seq-4 { transition-delay: 0.4s; }

.bank-icon { color: var(--color-text-main); opacity: 0.6; flex-shrink: 0; }
.bank-info { display: flex; flex-direction: column; flex-grow: 1; }
.bank-label { font-size: 0.8rem; color: var(--color-text-light); margin-bottom: 0.2rem; }
.bank-info strong { font-weight: 600; font-size: 1.05rem; letter-spacing: 0.5px; word-break: break-all; }

.btn-copy {
    background: var(--color-accent-light);
    border: none;
    color: var(--color-text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background var(--transition-smooth), transform var(--transition-smooth);
    flex-shrink: 0;
}

.btn-copy:hover, .btn-copy:focus-visible { background: rgba(92, 175, 179, 0.25); transform: translateY(-2px); }
.btn-copy.copied { background: #E8F5E9; color: #2E7D32; }


/* -- QUOTE -- */
.quote { text-align: center; padding: 2rem 1.5rem; margin-bottom: 6rem; }
.quote p { font-style: italic; font-size: 1.5rem; color: var(--color-text-main); line-height: 1.6; position: relative; display: inline-block; }
.quote p::after { content: ''; position: absolute; bottom: -25px; left: 50%; transform: translateX(-50%); width: 50px; height: 2px; background-color: var(--color-accent); opacity: 0.5; }


/* -- FOOTER -- */
.footer { width: 100%; position: relative; background-color: var(--color-text-main); color: rgba(255, 255, 255, 0.7); margin-top: auto; }
.footer-waves { position: absolute; top: -95px; left: 0; width: 100%; height: 100px; overflow: hidden; line-height: 0; }
.wave { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; }
.wave-1 { z-index: 1; height: 120%; top: -20px;}
.wave-2 { z-index: 2; height: 100%; top: -5px;}
.wave-3 { z-index: 3; height: 100%; }

.footer-content { padding: 4rem 1.5rem 3rem 1.5rem; display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; font-size: 0.9rem; }
.footer-left p { margin-bottom: 0.2rem; }
.footer-links { display: flex; gap: 2rem; align-items: center; }
.footer-links a, .btn-text { color: rgba(255, 255, 255, 0.7); transition: color var(--transition-smooth); background: none; border: none; padding: 0; font-size: 0.9rem; }
.footer-links a:hover, .btn-text:hover { color: #ffffff; }

.footer-signature { font-family: 'Brush Script MT', cursive, "Comic Sans MS", sans-serif; font-size: 1.8rem; color: #ffffff; opacity: 0.9; text-align: right; line-height: 1.1; transform: rotate(-3deg); }


/* -- GENERAL ANIMATIONS -- */
.animate-on-scroll { opacity: 0; transform: translateY(20px); transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }


/* -- COOKIE BANNER -- */
.cookie-banner { position: fixed; bottom: 0; left: 0; width: 100%; background-color: var(--color-bg); border-top: 1px solid rgba(11, 74, 93, 0.1); padding: 1.5rem; box-shadow: 0 -10px 30px rgba(0,0,0,0.05); z-index: 9000; transform: translateY(100%); transition: transform var(--transition-smooth); }
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-content { max-width: 900px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.cookie-content p { font-size: 0.9rem; color: var(--color-text-light); margin-top: 0.5rem; }
.cookie-actions { display: flex; gap: 1rem; flex-shrink: 0; }
.btn-primary { background-color: var(--color-text-main); color: var(--color-bg); padding: 0.6rem 1.5rem; border-radius: 20px; font-weight: 500; border: none; transition: background-color var(--transition-smooth); }
.btn-primary:hover { background-color: var(--color-accent); }

.cookie-modal { position: fixed; inset: 0; background-color: rgba(11, 74, 93, 0.5); backdrop-filter: blur(4px); z-index: 9001; display: flex; align-items: center; justify-content: center; padding: 1.5rem; opacity: 0; transition: opacity var(--transition-smooth); pointer-events: none;}
.cookie-modal.is-visible { opacity: 1; pointer-events: auto;}
.cookie-modal-content { background-color: var(--color-bg); border-radius: var(--border-radius-md); padding: 2.5rem; width: 100%; max-width: 500px; box-shadow: 0 15px 50px rgba(0,0,0,0.1); transform: translateY(20px); transition: transform var(--transition-smooth); }
.cookie-modal.is-visible .cookie-modal-content { transform: translateY(0); }
.cookie-options { margin: 2rem 0; display: flex; flex-direction: column; gap: 1.5rem; }
.cookie-option { display: flex; gap: 1rem; align-items: flex-start; }
.cookie-option span { font-size: 0.9rem; }
.cookie-modal-actions { display: flex; justify-content: space-between; margin-top: 2rem; }


/* -- MEDIA QUERIES -- */
@media (max-width: 1024px) {
    .donations-box { flex-direction: column; padding: 4rem 3rem; gap: 4rem; }
    .don-left, .don-right { width: 100%; }
    .footer-content { flex-direction: column; gap: 2rem; text-align: center; }
    .footer-signature { text-align: center; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2rem; letter-spacing: 1px; }
    .hero-subtitle { font-size: 0.85rem; letter-spacing: 2px; margin-bottom: 2rem; }
    .coming-title { font-size: 1.8rem; }
    .coming-desc { font-size: 1.05rem; }
    .hero-sequence-container { margin-top: 20vh; }
    
    .values { padding: 3rem 1.5rem; }
    .values-title { font-size: 2rem; }
    .values-grid { flex-direction: column; gap: 2.5rem; }
    .values-wave-line { display: none; }
    .value-item { max-width: 300px; margin: 0 auto; }
    
    .donations-box { padding: 3rem 1.5rem; }
    .don-main-title span { font-size: 2.2rem; }
    .bank-row { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.5rem; }
    .btn-copy { width: 100%; justify-content: center; padding: 0.8rem; }
    .bank-info { width: 100%; }
    .bank-info strong { word-break: break-all; }

    .cookie-content { flex-direction: column; text-align: center; }
}
