@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* --- Deep Design Palette --- */
    --bg-dark: #020405;
    /* Increased opacity for better readability on bright backgrounds */
    --bg-panel: rgba(5, 10, 15, 0.85);

    --primary: #00F0FF;
    --primary-glow: rgba(0, 240, 255, 0.5);
    --secondary: #7000FF;
    /* Neon Purple for contrast */

    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    /* Lighter gray for better contrast */

    --border: rgba(255, 255, 255, 0.15);
    --border-highlight: rgba(0, 240, 255, 0.5);

    --glass-blur: 20px;

    /* --- RADICAL THEME (MarcoBrotto.it Alignment) --- */
    --void-bg: #000000;
    --void-card: #0a0a0a;
    --neon-blue: #00f3ff;
    /* The "Cyber Cyan" */
    --neon-green: #0aff00;
    --neon-purple: #bd00ff;
    --radical-font: 'Inter', sans-serif;
}

/* VERCEL TABLES (List Style) */
.vercel-table {
    width: 100%;
    border-collapse: collapse;
    color: #ccc;
    font-size: 0.95rem;
}

.vercel-table th {
    text-align: left;
    padding: 16px;
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-bottom: 1px solid #222;
}

.vercel-table td {
    padding: 20px 16px;
    border-bottom: 1px solid #1a1a1a;
}

.vercel-table tr:last-child td {
    border-bottom: none;
}

.vercel-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
}

/* MASSIVE TYPOGRAPHY */
.massive-title {
    font-family: var(--radical-font);
    font-size: clamp(3.5rem, 9vw, 9rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 30px;
    text-shadow: 0 0 40px rgba(0, 243, 255, 0.2);
}

.text-stroke {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.4);
    color: transparent;
}

body[data-page="Famiglie"] {
    background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)), url('../assets/img_modern/bg_famiglie.png');
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
    /* Removed blend-mode to rely on gradient overlay */
}

body[data-page="Imprese"] {
    background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)), url('../assets/img_modern/bg_imprese.png');
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
}

body[data-page="Palestre"] {
    background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)), url('../assets/img_modern/bg_palestre.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body[data-page="ZarAI"] {
    background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)), url('../assets/img_modern/bg_zar.png');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--void-bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    /* VERCEL CORE: Invisible Grid Texture */
    background-image:
        radial-gradient(circle at 50% 0%, rgba(50, 50, 50, 0.4) 0%, transparent 60%),
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px;
    /* Grid size */
    background-attachment: fixed;
}

/* VERCEL CORE: Typography & Layout */
.page-header-wrapper {
    margin-top: 120px;
    margin-bottom: 48px;
    text-align: center;
}

.page-title-vercel {
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.04em;
    color: #fff;
    margin-bottom: 16px;
}

.page-sub-vercel {
    color: #888;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* VERCEL BENTO GRID SYSTEM */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.bento-card {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid #222;
    border-radius: 12px;
    padding: 32px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.bento-card:hover {
    border-color: #444;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Border Glow Effect (Pseudo) */
.bento-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.bento-card:hover::before {
    opacity: 1;
}

/* Removed stray styles */

/* Typography Gradient */
h1,
h2,
h3,
.brand-text {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Layout --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Advanced Header (LEGACY - RESTORED FOR COMPATIBILITY) --- */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(2, 4, 5, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 0;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand img.logo {
    height: 38px;
    width: auto;
}

.brand-text {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

.main-nav {
    display: flex;
    gap: 0;
    align-items: center;
}

.main-nav a {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #cbd5e1;
    letter-spacing: 0.05em;
    padding: 0 1.2rem;
    position: relative;
    line-height: 1;
}

/* Restored Separator */
.main-nav a:not(:last-child)::after {
    content: '|';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
}

.main-nav a:hover,
.main-nav a.active {
    color: #00F0FF;
}


/* --- RADICAL FLOATING DOCK HEADER --- */
.radical-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(10, 10, 10, 0.90);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    /* Pill shape */
    padding: 12px 30px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    width: auto;
    max-width: 95%;
    white-space: nowrap;
}

.radical-logo {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: -0.05em;
    color: #fff;
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    margin-right: 5px;
}

.radical-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.radical-nav a {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    /* Pill links */
    transition: all 0.2s ease;
    letter-spacing: 0.05em;
}

.radical-nav a:hover,
.radical-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--neon-blue);
    text-shadow: 0 0 15px var(--neon-blue);
}

/* Remove old nav separators/styles */
.nav-sep,
.main-nav {
    display: none;
}

/* Mobile adaptation for Dock */
@media (max-width: 768px) {
    .radical-header {
        top: 10px;
        width: 95%;
        padding: 10px 15px;
        flex-direction: column;
        border-radius: 20px;
        align-items: flex-start;
        gap: 10px;
    }

    .radical-logo {
        border-right: none;
        width: 100%;
        text-align: center;
        padding-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 10px;
    }

    .radical-nav {
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
    }
}


/* --- Hero Section with Texture --- */
.hero {
    position: relative;
    padding: 180px 0 100px;
    min-height: 50vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at 20% 30%, rgba(112, 0, 255, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 60%);
}

body[data-page="Home"] .hero {
    min-height: 85vh;
    background-image: url('../assets/img_modern/hero.png');
    background-size: cover;
    background-position: center;
}

/* Dark Overlay for readability */
body[data-page="Home"] .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(2, 4, 5, 0.5), var(--bg-dark));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

/* Page Title - Restored to Pure White for maximum legibility */
.page-title {
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    color: #ffffff;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: initial;
    /* Strong White Glow */
    text-shadow:
        0 4px 10px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(0, 240, 255, 0.4);
    filter: none;
}

/* Fix for child spans */
.page-title span {
    -webkit-text-fill-color: initial;
    text-fill-color: initial;
    background: none;
    text-shadow: none;
    color: var(--primary);
    /* Keep spans (accents) colored */
}

.subtitle {
    font-size: 1.35rem;
    color: #ffffff;
    max-width: 680px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 1);
    background: rgba(0, 0, 0, 0.6);
    /* Dark plate for readability */
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    margin: 0 auto;
}


/* --- Glass Cards --- */
main {
    position: relative;
    z-index: 10;
    padding-bottom: 100px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 30px;
}

.card {
    background: rgba(20, 25, 35, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: var(--border-highlight);
    box-shadow: 0 30px 60px rgba(0, 240, 255, 0.15);
}

.card-image-wrapper {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.card-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-panel), transparent);
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.card:hover .card-image-wrapper img {
    transform: scale(1.1);
}

.card-body {
    padding: 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.card p {
    color: #e2e8f0;
    margin-bottom: 24px;
    font-size: 1.1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
}

/* --- Neon Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid transparent;
}

.btn-primary {
    background: rgba(0, 240, 255, 0.1);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.btn-primary:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 40px var(--primary-glow);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-ghost:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}


/* --- Infographics (Responsive Image) --- */
/* Global Figure Centering */
figure {
    display: block;
    margin: 40px auto;
    text-align: center;
    width: 100%;
}

img.infografica,
.infografica-wis img {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border-radius: 24px;
    border: 1px solid var(--border-highlight);
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.1);
    margin: 0 auto;
    /* Margin controlled by figure now */
    display: inline-block;
    transition: transform 0.3s;
}

img.infografica:hover {
    transform: scale(1.01);
}

figcaption {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 12px;
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}


/* --- Inner Page Readability --- */
.container>p,
.container>ul,
.container>ol {
    max-width: 800px;
    color: #d1d5db;
    font-size: 1.1rem;
    margin-left: auto;
    margin-right: auto;
}

.container>h2 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-top: 60px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    display: block;
    text-align: center;
}

/* --- Compatibility --- */
.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    padding-top: 120px;
}

.hero+.wrap {
    padding-top: 0;
}

header.wrap {
    padding-top: 120px;
    margin-bottom: 40px;
    font-family: 'Inter', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-align: center;
}

header.wrap a {
    color: var(--primary);
}

/* Bonus Section Cards */
.home-bonus {
    margin-top: 60px;
}

.bonus-legend {
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 700;
    background: rgba(0, 240, 255, 0.05);
    margin-bottom: 30px;
    display: inline-block;
}

/* Footer */
.site-footer {
    background: #020202;
    border-top: 1px solid var(--border);
    padding: 60px 0;
    margin-top: 100px;
    color: #666;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding-top: 140px;
        padding-bottom: 60px;
        text-align: center;
        min-height: auto;
    }


    .hero-content {
        margin: 0 auto;
    }

    .page-title {
        font-size: 2.8rem;
    }

    .header-row {
        flex-direction: column;
        gap: 16px;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .card-body {
        padding: 24px;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    /* --- Component Restoration & Legibility Fixes --- */

    /* Section Blocks */
    .block {
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 24px;
        margin-bottom: 24px;
        backdrop-filter: blur(12px);
    }

    .block.accent {
        border-color: var(--primary-glow);
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.05) inset;
    }

    .block h2 {
        color: var(--primary);
        font-size: 1.5rem;
        margin-bottom: 16px;
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    }

    .block p,
    .block li {
        font-size: 1.1rem;
        color: #e2e8f0;
        /* Brighter text for legibility */
    }

    /* KPI Cards */
    .kpis {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 16px;
        margin: 24px 0;
    }

    .kpi {
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid var(--border-highlight);
        border-radius: 16px;
        padding: 16px;
        text-align: center;
    }

    .kpi .label {
        font-size: 0.85rem;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 1px;
        margin-bottom: 8px;
    }

    .kpi .value {
        font-family: 'Inter', sans-serif;
        font-weight: 800;
        font-size: 1.8rem;
        color: #fff;
        text-shadow: 0 0 15px var(--primary);
    }

    /* Nav Chips */
    .navchips {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 30px;
    }

    .chip {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border);
        padding: 8px 16px;
        border-radius: 50px;
        font-size: 0.9rem;
        color: var(--text-main);
        transition: 0.3s;
    }

    .chip:hover {
        background: var(--primary);
        color: #000;
        border-color: var(--primary);
        box-shadow: 0 0 15px var(--primary-glow);
    }

    /* Restored Infographic Styling */
    img.infografica {
        border: 2px solid var(--secondary);
        /* Purple border for contrast */
        box-shadow: 0 0 30px rgba(112, 0, 255, 0.2);
        background: rgba(255, 255, 255, 0.02);
        /* Slight bg to separate form dark */
    }

    figcaption {
        color: var(--text-muted);
        font-size: 0.95rem;
        text-align: center;
        margin-top: 12px;
        font-style: italic;
    }

    /* Badges */
    .badge {
        display: inline-block;
        background: linear-gradient(90deg, var(--secondary), var(--primary));
        color: #fff;
        padding: 4px 12px;
        border-radius: 50px;
        font-weight: 700;
        font-size: 0.85rem;
        text-transform: uppercase;
        margin-bottom: 12px;
    }

    /* Callout */
    .callout {
        background: rgba(0, 240, 255, 0.05);
        border-left: 4px solid var(--primary);
        padding: 16px;
        margin-top: 20px;
        font-weight: 600;
        color: #fff;
        border-radius: 0 12px 12px 0;
    }

    /* Mobile Friendly */
    @media (max-width: 640px) {
        .kpis {
            grid-template-columns: 1fr 1fr;
        }

        .block {
            padding: 16px;
        }
    }