:root {
    --bg-color: #f5f5f7;
    /* Apple's signature light gray */
    --text-primary: #1d1d1f;
    /* Apple's nearly black */
    --text-secondary: #86868b;
    /* Apple's gray */
    --accent-primary: #0071e3;
    /* Apple Blue */
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.06);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Inter is the best open source match for SF Pro */

    /* iPhone-inspired Gradients */
    --card-blue-start: #dbeafe;
    --card-blue-end: #bfdbfe;
    --card-purple-start: #f3e8ff;
    --card-purple-end: #e9d5ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.2;
    /* Tighter leading like the image */
    letter-spacing: -0.03em;
    /* Tighter tracking like the image */
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    /* Critical for that crisp MacOS look */
    -moz-osx-font-smoothing: grayscale;
}

/* Texture Overlay for Grain */
.bg-mesh {
    display: none;
}

/* Remove Color Blobs */
.blob {
    display: none;
}

/* Remove specific blob styles */


@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* Refined Typography for Ivory Theme */
.gradient-text {
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navbar removed */

/* Buttons */
.cta-button,
.cta-button-small {
    background: #18181b;
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    /* Slightly more square for tech feel */
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: 1px solid transparent;
}

.cta-button-small {
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
}

.cta-button {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    display: inline-block;
}

.cta-button::after {
    display: none;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #27272a;
}

.secondary-button {
    background: transparent;
    color: var(--text-primary);
    padding: 1rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    border: 1px solid #e5e5e5;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background: white;
    border-color: #d4d4d8;
    box-shadow: var(--shadow-soft);
}

/* Hero Section */
.hero {
    min-height: auto;
    /* Let content dictate height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 6rem;
    /* Standard desktop spacing */
    padding-bottom: 4rem;
    width: 100%;
    margin: 0 auto;
}

.hero-text-center {
    text-align: center;
    max-width: 800px;
    padding: 0 5%;
    margin-bottom: 4rem;
    z-index: 10;
}

.super-title {
    color: #e65100;
    /* Vivid Orange or generic 'accent' kicker */
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-size: 4rem;
    /* Similar to H2 3rem but main title */
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text-primary);
    background: none;
    /* Reset distinct gradient background of previous H1 */
    -webkit-text-fill-color: initial;
}

/* Use the common gradient-text class if span is used */
.hero h1 .gradient-text {
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Full Width Video */
.hero-video-full {
    width: 100%;
    display: flex;
    justify-content: center;
}

.video-container-full {
    width: 100%;
    /* No max-width -> Full Window Width */
    aspect-ratio: 16 / 9;
    /* Optional: Limit height if it gets too huge on ultra-wide screens, 
       but user said 'largo quanto la finestra' */
    max-height: 90vh;
    border-radius: 0;
    /* Full edge to edge usually implies no radius or small one? 
                         Let's keep it clean squares or maybe 0 if truly full width */
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.video-container-full iframe {
    width: 100%;
    height: 100%;
}

/* Glass Cards for Features & Pillars */
.features,
.pillars {
    padding: 4rem 5%;
    /* Reduced spacing from 8rem */
    max-width: 1400px;
    margin: 0 auto;
}

.features h2,
.pillars h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 5rem;
    font-size: 1.25rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Pillars Stacking Effect */
.pillar-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Remove gap to ensure smooth overlay */
    padding-bottom: 20vh;
}

.pillar-card {
    background: var(--bg-color);
    padding: 3rem 5%;
    /* Horizontal padding relative to screen */
    border-radius: 40px 40px 0 0;
    /* Rounded top only like a folder tab */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: none;
    /* Looks like continuous sheet */
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
    /* Stronger shadow on top */
    position: sticky;
    width: 100%;
    min-height: 80vh;
    /* Make each card tall enough to fill screen */
    color: var(--text-primary);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Stacking Offsets - Uniform top to fully cover previous cards */
.pillar-card {
    top: 60px;
    /* All cards stack at the same position */
}

/* Ensure Z-Index ensures correct layering (though DOM order usually handles this) */
/* Feature Cards - Apple Promo Style (Image Backgrounds) */
.features .grid {
    gap: 2rem;
}

.features .card {
    height: 500px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
    /* Context for texture overlay */
}

/* Texture Overlay for Pillars */
.pillar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('risorse/pillar_texture.png');
    background-size: cover;
    background-position: center;
    opacity: 0.65;
    /* Strongly visible texture */
    mix-blend-mode: overlay;
    /* Blends with gradient */
    z-index: 1;
    pointer-events: none;
}

/* Ensure content is above texture */
.pillar-card .pillar-number,
.pillar-card .pillar-content {
    position: relative;
    z-index: 2;
}

.features .card h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #1d1d1f;
    z-index: 2;
}

.features .card p {
    font-size: 1.1rem;
    color: #424245;
    max-width: 300px;
    z-index: 2;
}

/* Hide Icons for Image Cards (Clean Apple Look) */
.features .card .icon {
    display: none;
}

/* Card 1: Zero Slide (Macbook/Code) */
.features .card:nth-child(1) {
    background-image: url('risorse/feature_zero_slide_1770156954474.png');
}

/* Card 2: Pragmaticità (Precision Object) */
.features .card:nth-child(2) {
    background-image: url('risorse/feature_pragmatic_1770156967643.png');
}

/* Card 3: Interazione (Network Spheres) */
.features .card:nth-child(3) {
    background-image: url('risorse/feature_interaction_1770156981080.png');
}

/* Z-Index Stacking Order - MUST be sequential */
.pillar-card:nth-child(1) {
    z-index: 10;
}

.pillar-card:nth-child(2) {
    z-index: 20;
}

.pillar-card:nth-child(3) {
    z-index: 30;
}

.pillar-card:nth-child(4) {
    z-index: 40;
}

.pillar-card:nth-child(5) {
    z-index: 50;
}

.pillar-card:nth-child(6) {
    z-index: 60;
}

.pillar-card:nth-child(7) {
    z-index: 70;
}

.pillar-card:nth-child(8) {
    z-index: 80;
}

/* Pillar Cards - Recurring iPhone 16 Gradients */
/* Cycle: Teal -> Pink -> Ultramarine */

/* Teal Gradient Cards (1, 4, 7) */
.pillar-card:nth-child(1),
.pillar-card:nth-child(4),
.pillar-card:nth-child(7) {
    background: linear-gradient(to bottom, #8eaeb3 0%, #f4fbfb 100%);
    color: #0f172a;
}

.pillar-card:nth-child(1) h3,
.pillar-card:nth-child(4) h3,
.pillar-card:nth-child(7) h3 {
    color: #134e4a;
    border-color: rgba(19, 78, 74, 0.2);
}

/* Pink Gradient Cards (2, 5, 8) */
.pillar-card:nth-child(2),
.pillar-card:nth-child(5),
.pillar-card:nth-child(8) {
    background: linear-gradient(to bottom, #cabae2 0%, #fbf7ff 100%);
    color: #4a044e;
}

.pillar-card:nth-child(2) h3,
.pillar-card:nth-child(5) h3,
.pillar-card:nth-child(8) h3 {
    color: #581c87;
    border-color: rgba(88, 28, 135, 0.2);
}

/* Ultramarine Gradient Cards (3, 6) */
.pillar-card:nth-child(3),
.pillar-card:nth-child(6) {
    background: linear-gradient(to bottom, #4350b0 0%, #eff4ff 100%);
    color: #172554;
}

.pillar-card:nth-child(3) h3,
.pillar-card:nth-child(6) h3 {
    color: white;
    /* Header still white on dark blue top */
    border-color: rgba(255, 255, 255, 0.3);
}

.pillar-card:nth-child(3) p,
.pillar-card:nth-child(6) p {
    color: #1e3a8a;
}

.pillar-card h3 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent-secondary);
    padding-bottom: 1rem;
    width: 100%;
}

.pillar-number {
    position: static;
    font-size: 4rem;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.08);
    margin-left: 20px;
}

.pillar-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.pillar-card p {
    font-size: 1.2rem;
    max-width: 800px;
}

/* Ensure hover doesn't break sticky - Removed transform/z-index changes to prevent flickering */
.pillar-card:hover {
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.12);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-hover);
    background: rgba(255, 255, 255, 0.9);
}

.card:hover::before {
    opacity: 1;
}

/* Common Icon Style for SVGs */
.icon svg {
    width: 64px;
    height: 64px;
    stroke-width: 1.5;
}

.icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

/* CTA Section */
.cta-section {
    padding: 8rem 5%;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 4rem;
    background: linear-gradient(135deg, #fff, #f3f4f6);
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

.cta-section h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    color: var(--text-secondary);
    position: relative;
}

/* New Framed CTA Box */
.cta-box {
    background: rgba(255, 255, 255, 0.8);
    border: 3px solid #34d399;
    /* Inviting Green */
    border-radius: 24px;
    padding: 2.5rem 2rem;
    max-width: 650px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    box-shadow: 0 15px 40px rgba(52, 211, 153, 0.15);
    backdrop-filter: blur(10px);
}

.cta-label {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.cta-target-text {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    /* Green to Blue */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.cta-phone-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: white !important;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.cta-phone-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

.cta-phone-button svg {
    margin-right: 12px;
    width: 28px;
    height: 28px;
}

/* Footer */
footer {
    padding: 3rem 5%;
    text-align: center;
    color: var(--text-secondary);
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Mobile */
@media (max-width: 768px) {
    .navbar {
        top: 0;
        border-radius: 0;
        width: 100%;
        left: 0;
        transform: none;
        padding: 1rem 5%;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 2rem;
        /* Reduced mobile spacing */
        padding-bottom: 0;
        /* Remove bottom padding on mobile */
    }

    .hero-text-center {
        margin-top: 0;
        margin-bottom: 2rem;
    }

    .hero h1 {
        font-size: 3rem;
        margin-top: 0;
        /* Remove potential default margins */
        line-height: 1.1;
    }

    .cta-group {
        justify-content: center;
    }

    .video-container {
        transform: none;
        border-width: 4px;
    }

    .video-container-full {
        margin-bottom: 0;
        /* REMOVED ALL SPACER */
    }

    .hero-video-full {
        margin-top: 1rem;
    }

    .features h2 {
        margin-top: 0;
        /* Remove H2 top margin */
        padding-top: 0;
    }

    .features {
        margin-top: 2rem;
        /* Increased spacing */
        padding-top: 0;
    }

    /* Mobile adjustments for Pillar Cards */
    .pillar-card h3 {
        font-size: 2rem;
        /* Smaller title on mobile */
        padding-right: 20px;
        /* Safety margin on right */
        word-wrap: break-word;
        /* Prevent overflow */
        hyphens: auto;
        /* Optional: cleaner breaking */
        line-height: 1.1;
    }

    .pillar-card {
        padding: 2rem 5%;
        /* Slightly less vertical padding */
    }

    /* Force texture visibility on mobile */
    .pillar-card::before {
        mix-blend-mode: normal !important;
        opacity: 0.25 !important;
    }

    .cta-section h2 {
        font-size: 2.5rem;
        /* Smaller CTA title on mobile */
    }

    .cta-target-text {
        font-size: 1.5rem;
        /* Much smaller to fit long words like ASSOCIAZIONE */
        word-wrap: break-word;
    }

    .cta-box {
        padding: 2rem 1rem;
        /* More horizontal space for text */
    }

    .features {
        padding-top: 0;
        /* Zero spacing for mobile */
    }
}