/* CSS Variables & Theme Definition */
:root {
    /* Color Palette */
    --primary-blue: #0A192F; /* Deep Navy Blue */
    --accent-blue: #112240;
    --slate-gray: #64748B;
    --slate-light: #94A3B8;
    --white: #FFFFFF;
    --bg-light: #F8FAFC;
    --highlight: #38BDF8; /* Subtle tech vibrant blue */
    --text-main: #1E293B;
    --text-muted: #475569;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Layout & Effects */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(10, 25, 47, 0.05);
    --container-width: 1200px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-blue);
    margin-bottom: 1rem;
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-center {
    text-align: center;
}

.mt-5 {
    margin-top: 3rem;
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--highlight);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 1.5rem auto 0;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--glass-shadow);
    padding: 0.5rem 0;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: -0.5px;
}

.logo-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--highlight);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--highlight);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--primary-blue);
}

.nav-social {
    display: flex;
    gap: 1rem;
}

.nav-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--primary-blue);
    transition: var(--transition);
}

.nav-social a:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-blue);
}

/* Header / Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
    overflow: hidden;
    background: radial-gradient(circle at center, #112240 0%, #0A192F 100%);
    color: var(--white);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.4;
    animation: float 10s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(56, 189, 248, 0.3);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: rgba(100, 116, 139, 0.3);
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 50px) rotate(20deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero .subtitle {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--slate-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.hero .title {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero .highlight {
    color: var(--highlight);
    font-weight: 300;
}

.hero .description {
    font-size: 1.25rem;
    color: var(--slate-light);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--highlight);
    color: var(--primary-blue);
    border: 2px solid var(--highlight);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--highlight);
    box-shadow: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--slate-gray);
}

.btn-secondary:hover {
    border-color: var(--white);
    background-color: rgba(255, 255, 255, 0.1);
}

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

.btn-outline i {
    margin-right: 0.5rem;
}

.btn-outline:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(10, 25, 47, 0.05);
    transition: var(--transition);
    border: 1px solid rgba(100, 116, 139, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--primary-blue);
    transition: var(--transition);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-card:hover::before {
    height: 100%;
}

.service-card:hover h3,
.service-card:hover p {
    color: var(--white);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--highlight);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.service-card p {
    transition: var(--transition);
}

/* Portfolio / Esperienza */
.experience-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.experience-content .section-title::after {
    left: 0;
    transform: none;
}

.large-text {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 3rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1;
}

.stat-plus {
    font-size: 2rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--highlight);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.experience-timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--slate-light);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2.65rem;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border: 4px solid var(--highlight);
    border-radius: 50%;
}

.timeline-item h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.timeline-date {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--primary-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

/* Blog / Divulgazione */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.blog-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(10, 25, 47, 0.05);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(10, 25, 47, 0.1);
}

.blog-img {
    position: relative;
    aspect-ratio: 16 / 9;
    height: auto;
    overflow: hidden;
}

.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.blog-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.blog-content {
    padding: 2rem;
}

.blog-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.blog-card:hover h3 {
    color: var(--highlight);
}

.read-more {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--primary-blue);
    margin-top: 1rem;
}

.read-more i {
    margin-left: 0.5rem;
    transition: var(--transition);
}

.read-more:hover i {
    transform: translateX(5px);
}

/* Instagram Feed */
.ig-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.ig-post {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: block;
}

.ig-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ig-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: var(--transition);
}

.ig-post:hover .ig-overlay {
    opacity: 1;
}

.ig-post:hover img {
    transform: scale(1.1);
}

.ig-text {
    color: var(--white);
    text-align: center;
    font-size: 1.125rem;
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 1.5;
}

/* Footer */
.footer {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 5rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand h3 {
    color: var(--white);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--slate-light);
    max-width: 400px;
}

.footer-links h4,
.footer-social h4 {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--slate-light);
}

.footer-links a:hover {
    color: var(--highlight);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--highlight);
    color: var(--primary-blue);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: var(--slate-light);
    font-size: 0.875rem;
    margin: 0;
}

/* Animations Reveal */
.reveal {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.fade-up { transform: translateY(50px); }
.fade-right { transform: translateX(-50px); }
.fade-left { transform: translateX(50px); }
.zoom-in { transform: scale(0.9); }

/* Responsive Design */
@media (max-width: 992px) {
    .hero .title { font-size: 3.5rem; }
    .experience-wrapper { grid-template-columns: 1fr; gap: 3rem; }
    .footer-content { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
    .nav-links, .nav-social { display: none; }
    .menu-toggle { display: block; }
    
    .hero { padding-top: 6rem; }
    .hero .title { font-size: 2.5rem; }
    .hero-cta { flex-direction: column; }
    .btn { width: 100%; }
    
    .footer-content { grid-template-columns: 1fr; }
    
    /* Mobile Menu Active */
    .nav-active .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 2rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
    .nav-active .nav-links a { color: var(--text-main); font-size: 1.25rem; }
    .nav-active .nav-social {
        display: flex;
        position: absolute;
        top: 100%;
        right: 2rem;
        margin-top: 2rem;
    }
}
