/* ============================================
   WAVE LIGHT - Design System
   Premium Agency Website
   ============================================ */

/* Font locali (GDPR-compliant, nessun dato trasferito a Google) */
@import url('fonts.css');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Primary Colors */
    --color-primary-900: #0a0f1a;
    --color-primary-800: #0d1829;
    --color-primary-700: #112240;
    --color-primary-600: #1a365d;
    --color-primary-500: #234681;
    
    /* Accent Colors */
    --color-accent-primary: #64ffda;
    --color-accent-secondary: #38bdf8;
    --color-accent-tertiary: #a78bfa;
    --color-accent-glow: rgba(100, 255, 218, 0.15);
    
    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    
    /* Semantic */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    /* Gradients */
    --gradient-accent: linear-gradient(135deg, var(--color-accent-primary) 0%, var(--color-accent-secondary) 100%);
    --gradient-text: linear-gradient(135deg, var(--color-accent-primary) 0%, var(--color-accent-secondary) 50%, var(--color-accent-tertiary) 100%);
    
    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'Space Grotesk', monospace;
    
    /* Fluid Typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.4rem + 2.25vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.5rem + 3.75vw, 3.5rem);
    --text-5xl: clamp(2.2rem, 2rem + 5vw, 4.5rem);
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-glow: 0 0 40px rgba(100, 255, 218, 0.3);
    --shadow-glow-sm: 0 0 20px rgba(100, 255, 218, 0.2);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Z-Index */
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 500;
    
    /* Container */
    --container-max: 1400px;
    --container-padding: clamp(1rem, 5vw, 3rem);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-gray-300);
    background-color: var(--color-primary-900);
    overflow-x: hidden;
}

::selection {
    background-color: var(--color-accent-primary);
    color: var(--color-primary-900);
}

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

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

ul, ol {
    list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-white);
}

/* ============================================
   UTILITIES
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--space-24) 0;
}

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-4);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-16);
}

.section-header h2 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
}

.section-header p {
    font-size: var(--text-lg);
    color: var(--color-gray-400);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-fixed);
    padding: var(--space-4) 0;
    transition: all var(--transition-base);
}

.navbar.scrolled {
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    padding: var(--space-3) 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-white);
    z-index: 10;
}

.logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border-radius: var(--radius-lg);
    position: relative;
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--color-primary-900);
    border-radius: calc(var(--radius-lg) - 3px);
}

.logo-icon svg {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    color: var(--color-accent-primary);
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-links li a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-gray-300);
    transition: color var(--transition-fast);
    position: relative;
    padding: var(--space-2) 0;
}

.nav-links li a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--transition-base);
}

.nav-links li a:not(.btn):hover {
    color: var(--color-white);
}

.nav-links li a:not(.btn):hover::after {
    transform: scaleX(1);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-2);
    z-index: 10;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--color-white);
    transition: all var(--transition-fast);
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--color-primary-900);
    box-shadow: var(--shadow-glow-sm);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent-primary);
    border: 2px solid var(--color-accent-primary);
}

.btn-secondary:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-3px);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.btn:hover svg {
    transform: translateX(4px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: calc(80px + var(--space-16)) 0 var(--space-16);
    overflow: hidden;
}

/* Hero Background */
.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-800) 50%, var(--color-primary-700) 100%);
}

/* Animated Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(100, 255, 218, 0.15);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(56, 189, 248, 0.1);
    top: 50%;
    right: -15%;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: rgba(167, 139, 250, 0.08);
    bottom: -10%;
    left: 30%;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

/* Grid Pattern */
.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(100, 255, 218, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 255, 218, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* Hero Content */
.hero-content {
    max-width: 850px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-accent-primary);
    margin-bottom: var(--space-6);
    animation: fadeInUp 0.6s ease forwards;
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-6);
    animation: fadeInUp 0.6s ease 0.1s forwards;
    opacity: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.hero-subtitle {
    font-size: var(--text-xl);
    color: var(--color-gray-400);
    max-width: 650px;
    line-height: 1.7;
    margin-bottom: var(--space-10);
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-16);
    animation: fadeInUp 0.6s ease 0.3s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: var(--space-12);
    animation: fadeInUp 0.6s ease 0.4s forwards;
    opacity: 0;
}

.hero-stat {
    text-align: left;
}

.stat-number {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-white);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-number .accent {
    color: var(--color-accent-primary);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-10);
}

/* Service Card */
.service-card {
    position: relative;
    padding: var(--space-8);
    background: rgba(17, 34, 64, 0.4);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-2xl);
    transition: all var(--transition-base);
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top left, rgba(100, 255, 218, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(100, 255, 218, 0.3);
    box-shadow: var(--shadow-glow-sm);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
    color: var(--color-accent-primary);
    transition: all var(--transition-base);
}

.service-card:hover .service-icon {
    background: var(--gradient-accent);
    color: var(--color-primary-900);
    transform: scale(1.1);
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.service-card h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
    position: relative;
}

.service-card p {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    line-height: 1.7;
    position: relative;
}

/* ============================================
   WHY US / FEATURES SECTION
   ============================================ */
.why-us-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
}

.why-us-content {
    max-width: 540px;
}

.why-us-content h2 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-6);
}

.why-us-content > p {
    font-size: var(--text-lg);
    color: var(--color-gray-400);
    margin-bottom: var(--space-10);
    line-height: 1.7;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.feature-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-lg);
    color: var(--color-accent-primary);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-item h4 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-1);
    line-height: 1.3;
}

.feature-item p {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    line-height: 1.5;
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.stat-card {
    padding: var(--space-8);
    background: rgba(17, 34, 64, 0.5);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: rgba(100, 255, 218, 0.3);
    transform: translateY(-4px);
}

.stat-card .stat-number {
    font-size: var(--text-4xl);
    color: var(--color-accent-primary);
    margin-bottom: var(--space-2);
}

.stat-card .stat-label {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
}

/* ============================================
   PROCESS SECTION
   ============================================ */
.process-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
    position: relative;
}

.process-timeline::before {
    content: '';
    position: absolute;
    top: 45px;
    left: 12.5%;
    width: 75%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    opacity: 0.3;
}

.process-step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 90px;
    height: 90px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-800);
    border: 2px solid var(--color-accent-primary);
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-accent-primary);
    position: relative;
    z-index: 1;
    transition: all var(--transition-base);
}

.process-step:hover .step-number {
    background: var(--gradient-accent);
    color: var(--color-primary-900);
    transform: scale(1.1);
}

.process-step h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

.process-step p {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    line-height: 1.6;
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-12);
}

.portfolio-header .section-label {
    margin-bottom: var(--space-4);
}

.portfolio-header h2 {
    font-size: var(--text-4xl);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: var(--space-10);
    margin-bottom: var(--space-8);
}

/* Portfolio Card */
.portfolio-card {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    background: var(--color-primary-800);
    border: 1px solid rgba(100, 255, 218, 0.1);
    transition: all var(--transition-base);
}

.portfolio-card:hover {
    transform: translateY(-8px);
    border-color: rgba(100, 255, 218, 0.3);
    box-shadow: var(--shadow-glow-sm);
}

.portfolio-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-800) 100%);
}

.portfolio-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-accent);
    opacity: 0.1;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.05);
}

/* Placeholder for missing images */
.portfolio-image::after {
    content: attr(data-project);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: rgba(100, 255, 218, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.portfolio-content {
    padding: var(--space-8);
}

.portfolio-category {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-3);
}

.portfolio-card h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
    margin-top: var(--space-2);
}

.portfolio-card > p,
.portfolio-content > p {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    margin-bottom: var(--space-6);
    line-height: 1.7;
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-accent-primary);
}

.portfolio-link svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.portfolio-link:hover svg {
    transform: translateX(4px);
}

/* Overlay "Vedi Dettagli" */
.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.portfolio-card:hover .project-overlay {
    opacity: 1;
}

.btn-overlay {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a1a2e !important;
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-overlay:hover {
    background: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.btn-overlay svg {
    transition: transform 0.3s ease;
}

.btn-overlay:hover svg {
    transform: translateX(5px);
}

/* Spaziatura bottone finale */
.portfolio-section .text-center {
    margin-top: var(--space-12);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
    text-align: center;
    padding: var(--space-24) 0;
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(100, 255, 218, 0.1) 0%, transparent 60%);
}

.cta-content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-6);
}

.cta-content p {
    font-size: var(--text-lg);
    color: var(--color-gray-400);
    margin-bottom: var(--space-10);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--color-primary-900);
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer-brand {
    max-width: 320px;
}

.footer-brand .logo {
    margin-bottom: var(--space-5);
}

.footer-brand p {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    margin-bottom: var(--space-6);
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: var(--space-3);
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-lg);
    color: var(--color-gray-300);
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--color-accent-primary);
    color: var(--color-primary-900);
}

.social-link svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-column h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-6);
    color: var(--color-white);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-links a {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-accent-primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-8);
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.footer-bottom p {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

.footer-legal {
    display: flex;
    gap: var(--space-6);
}

.footer-legal a {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    transition: color var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--color-accent-primary);
}

/* ============================================
   PAGE HEADER (Portfolio, Preventivo)
   ============================================ */
.page-header {
    padding: calc(80px + var(--space-16)) 0 var(--space-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header .hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.page-header-sm {
    padding: calc(80px + var(--space-12)) 0 var(--space-12);
}

.page-header-content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
}

.page-subtitle {
    font-size: var(--text-lg);
    color: var(--color-gray-400);
    line-height: 1.7;
}

/* ============================================
   PORTFOLIO PAGE - Showcase
   ============================================ */
.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-12);
}

.filter-btn {
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-gray-300);
    background: transparent;
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--color-primary-900);
    background: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
}

/* Showcase Cards */
.portfolio-showcase {
    display: grid;
    gap: var(--space-16);
}

.showcase-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
    padding: var(--space-8);
    background: rgba(17, 34, 64, 0.3);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-2xl);
    transition: all var(--transition-base);
}

.showcase-card:hover {
    border-color: rgba(100, 255, 218, 0.3);
}

.showcase-card:nth-child(even) {
    direction: rtl;
}

.showcase-card:nth-child(even) > * {
    direction: ltr;
}

.showcase-image {
    aspect-ratio: 16/10;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-700), var(--color-primary-800));
    position: relative;
}

.showcase-image::after {
    content: attr(data-project);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: rgba(100, 255, 218, 0.3);
}

.showcase-content .portfolio-category {
    margin-bottom: var(--space-4);
}

.showcase-content h3 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
}

.showcase-content > p {
    font-size: var(--text-base);
    color: var(--color-gray-400);
    margin-bottom: var(--space-6);
    line-height: 1.7;
}

.showcase-stats {
    display: flex;
    gap: var(--space-8);
    margin-bottom: var(--space-6);
}

.showcase-stat .stat-number {
    font-size: var(--text-2xl);
    color: var(--color-accent-primary);
    margin-bottom: var(--space-1);
}

.showcase-stat .stat-label {
    font-size: var(--text-xs);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.tech-tag {
    padding: var(--space-1) var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-gray-300);
    background: rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-full);
}

/* Testimonials */
.testimonials-section {
    padding: var(--space-24) 0;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-8);
}

.testimonial-card {
    padding: var(--space-8);
    background: rgba(17, 34, 64, 0.5);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
}

.testimonial-card:hover {
    border-color: rgba(100, 255, 218, 0.3);
    transform: translateY(-4px);
}

.testimonial-stars {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
    color: #fbbf24;
}

.testimonial-stars svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.testimonial-text {
    font-size: var(--text-base);
    color: var(--color-gray-300);
    line-height: 1.7;
    margin-bottom: var(--space-6);
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--color-primary-900);
}

.testimonial-info h4 {
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
}

.testimonial-info p {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

/* ============================================
   CONTACT / QUOTE PAGE
   ============================================ */
.contact-section {
    padding-bottom: var(--space-24);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: var(--space-16);
    align-items: start;
}

.contact-info h2 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
}

.contact-info > p {
    font-size: var(--text-base);
    color: var(--color-gray-400);
    margin-bottom: var(--space-8);
    line-height: 1.7;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

.contact-method {
    display: flex;
    gap: var(--space-4);
}

.contact-method-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-lg);
    color: var(--color-accent-primary);
    flex-shrink: 0;
}

.contact-method-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.contact-method-text h4 {
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
}

.contact-method-text p,
.contact-method-text a {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
}

.contact-method-text a:hover {
    color: var(--color-accent-primary);
}

/* Trust Badges */
.trust-badges {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-gray-400);
}

.trust-badge svg {
    color: var(--color-accent-primary);
}

/* Contact Form */
.contact-form-wrapper {
    background: rgba(17, 34, 64, 0.5);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
}

.form-header {
    margin-bottom: var(--space-8);
}

.form-header h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.form-header p {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--color-success);
}

.secure-badge svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-gray-200);
    margin-bottom: var(--space-2);
}

.form-group label .required {
    color: var(--color-accent-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-4);
    background: rgba(10, 15, 26, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: var(--radius-lg);
    color: var(--color-white);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-gray-500);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364ffda' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    background-size: 18px;
    padding-right: var(--space-12);
}

.form-group select option {
    background: var(--color-primary-800);
    color: var(--color-white);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.error-message {
    font-size: var(--text-xs);
    color: var(--color-error);
    margin-top: var(--space-2);
    display: none;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--color-error);
}

.form-group.error .error-message {
    display: block;
}

.form-group.valid input,
.form-group.valid select,
.form-group.valid textarea {
    border-color: var(--color-success);
}

.char-counter {
    text-align: right;
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    margin-top: var(--space-2);
}

.char-counter.warning {
    color: var(--color-warning);
}

.char-counter.error {
    color: var(--color-error);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--color-accent-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: var(--text-sm);
    color: var(--color-gray-300);
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group label a {
    color: var(--color-accent-primary);
    text-decoration: underline;
}

/* Honeypot */
.honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Form Submit */
.form-submit {
    margin-top: var(--space-8);
}

.form-submit .btn {
    width: 100%;
}

.form-message {
    margin-top: var(--space-6);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-success);
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-error);
}

/* Loading Button */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading .btn-text,
.btn.loading svg {
    visibility: hidden;
}

.spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--color-primary-900);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   FAQ SECTION
   ============================================ */
.faq-section {
    padding: var(--space-24) 0;
    background: rgba(17, 34, 64, 0.2);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6) 0;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary span {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-white);
}

.faq-item summary svg {
    width: 24px;
    height: 24px;
    color: var(--color-accent-primary);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.faq-item[open] summary svg {
    transform: rotate(180deg);
}

.faq-item p {
    padding-bottom: var(--space-6);
    font-size: var(--text-base);
    color: var(--color-gray-400);
    line-height: 1.7;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}



/* RIGHT COLUMN - STACK CARDS */
.stack-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.stack-card{
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15) inset;
}

.stack-card-head{
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.stack-badge{
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(100, 255, 218, 0.10);
  color: var(--color-accent-primary);
  flex-shrink: 0;
}

.stack-badge svg{
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stack-title{
  font-size: var(--text-lg);
  margin: 0;
}

.stack-subtitle{
  margin: var(--space-1) 0 0 0;
  color: var(--color-gray-400);
  font-size: var(--text-sm);
}

.stack-pills{
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.stack-pill{
  font-size: var(--text-xs);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--color-gray-200);
}

.stack-list{
  margin: 0;
  padding-left: 18px;
  color: var(--color-gray-400);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.stack-cta{
  background: linear-gradient(
    180deg,
    rgba(100, 255, 218, 0.08),
    rgba(255,255,255,0.02)
  );
  border: 1px solid rgba(100, 255, 218, 0.20);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .why-us-grid {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
}

@media (max-width: 968px) {
    /* Mobile Navigation */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--space-6);
        background: var(--color-primary-800);
        padding: var(--space-8);
        transition: right var(--transition-base);
        z-index: var(--z-modal);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    /* Process Timeline */
    .process-timeline {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }
    
    .process-timeline::before {
        display: none;
    }
    
    /* Showcase Cards */
    .showcase-card {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        padding: var(--space-5);
    }

    .showcase-card:nth-child(even) {
        direction: ltr;
    }

    .showcase-content h3 {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-3);
    }

    .showcase-content .portfolio-category {
        margin-bottom: var(--space-3);
    }

    .showcase-content > p {
        margin-bottom: var(--space-4);
        line-height: 1.6;
    }

    .showcase-stats {
        gap: var(--space-4);
        margin-bottom: var(--space-4);
    }

    .tech-tags {
        margin-bottom: var(--space-4);
    }

    .portfolio-showcase {
        gap: var(--space-10);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Hero title: nascondi "straordinarie" e riduci font su mobile */
    .hero-extra {
        display: none !important;
    }

    .hero h1 {
        font-size: clamp(1.8rem, 1.5rem + 3vw, 2.5rem);
    }

    /* Form Grid */
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Trust Badges */
    .trust-badges {
        flex-direction: column;
        gap: var(--space-4);
    }
}

@media (max-width: 576px) {
    .section {
        padding: var(--space-16) 0;
    }
    
    /* Hero */
    .hero {
        padding-top: calc(80px + var(--space-12));
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta .btn {
        width: 100%;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-8);
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio */
    .portfolio-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    /* CTA */
    .cta-buttons {
        flex-direction: column;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   EXTRA SMALL SCREENS (< 480px)
   ============================================ */
@media (max-width: 480px) {
    .showcase-card {
        padding: var(--space-4);
        gap: var(--space-4);
    }

    .showcase-content h3 {
        font-size: var(--text-xl);
    }

    .showcase-stats {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .showcase-stat .stat-number {
        font-size: var(--text-lg);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .navbar,
    .hero-bg,
    .footer,
    .btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* Optional field badge */
.optional {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--color-gray-500);
    font-style: italic;
}

