/* --- VARIABILI GLOBALI E RESET --- */
:root {
    --bg-color: #E6E9F2;
    --primary-blue: #4A6CFD;
    --text-dark: #1A1A1A;
    --text-light: #7E8BB6;
    --card-bg: #FFFFFF;
    --header-bg-glass: rgba(255, 255, 255, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-dark); line-height: 1.6; }
body.no-scroll { overflow: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- HEADER E NAVBAR --- */
.header { position: sticky; top: 0; z-index: 1000; padding: 15px 0; background: var(--header-bg-glass); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
.navbar-container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-dark); font-weight: 700; font-size: 1.2rem; }
.logo img { width: 36px; height: 36px; }
.nav-links { list-style: none; display: flex; gap: 35px; }
.nav-links a { text-decoration: none; color: var(--text-dark); font-weight: 500; position: relative; padding-bottom: 5px; }
.nav-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--primary-blue); transition: width 0.3s ease; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.contact-button { background-color: var(--primary-blue); color: white; padding: 10px 25px; border-radius: 50px; text-decoration: none; font-weight: 500; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.contact-button:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(74, 108, 253, 0.4); }

/* --- MENU HAMBURGER E MOBILE --- */
.hamburger-menu { display: none; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 1010; }
.hamburger-menu span { display: block; width: 25px; height: 3px; margin: 5px 0; background-color: var(--text-dark); transition: all 0.3s ease-in-out; }
.hamburger-menu.is-active span { background-color: var(--text-dark); }
.hamburger-menu.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-menu.is-active span:nth-child(2) { opacity: 0; }
.hamburger-menu.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav { display: flex; flex-direction: column; gap: 20px; justify-content: center; align-items: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); z-index: 1005; transform: translateX(100%); transition: transform 0.3s ease-in-out; }
.mobile-nav.is-active { transform: translateX(0); }
.mobile-nav a { text-decoration: none; color: var(--text-dark); font-size: 1.8rem; padding: 10px; font-weight: 700; }
.contact-button-mobile { background-color: var(--primary-blue); color: white; padding: 10px 25px; border-radius: 50px; text-decoration: none; font-weight: 500; display: inline-block; margin-top: 10px; }
.mobile-nav-close { position: absolute; top: 20px; right: 25px; background: none; border: none; font-size: 2.5rem; color: var(--text-dark); cursor: pointer; }

/* --- HERO SECTION --- */
.hero-section { padding: 80px 0; }
.hero-container { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 60px; }
.hero-subtitle { font-weight: 500; color: var(--primary-blue); margin-bottom: 15px; }
.hero-title { font-size: 3.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 25px; }
.hero-description { color: var(--text-light); margin-bottom: 35px; max-width: 500px; }
.hero-buttons { display: flex; gap: 20px; }
.button-primary { background-color: var(--primary-blue); color: white; padding: 12px 30px; border-radius: 50px; text-decoration: none; font-weight: 500; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.button-primary:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(74, 108, 253, 0.4); }
.button-secondary { background-color: var(--card-bg); color: var(--text-dark); padding: 12px 30px; border-radius: 50px; text-decoration: none; font-weight: 500; border: 1px solid #ddd; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.button-secondary:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.hero-right { display: flex; justify-content: center; align-items: center; padding-left: 50px; }
.image-wrapper { position: relative; width: 350px; height: 350px; }
.image-blob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 100%; background: linear-gradient(45deg, rgba(74, 108, 253, 0.3), rgba(74, 108, 253, 0.1)); backdrop-filter: blur(20px); border-radius: 47% 53% 70% 30% / 30% 43% 57% 70%; animation: blob-morph 10s infinite alternate; }
@keyframes blob-morph { 0% { border-radius: 47% 53% 70% 30% / 30% 43% 57% 70%; } 100% { border-radius: 30% 70% 30% 70% / 70% 30% 70% 30%; } }
.image-wrapper img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* --- PORTFOLIO SECTION --- */
.portfolio-section { padding: 80px 0; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.portfolio-link { text-decoration: none; color: inherit; }
.card { background-color: var(--card-bg); border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07); transition: transform 0.3s ease, box-shadow 0.3s ease; overflow: hidden; padding: 0; display: flex; flex-direction: column; height: 100%; }
.card:hover { transform: translateY(-10px); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1); }
.card-preview { height: 180px; background-color: #f0f0f0; }
.card-preview img { width: 100%; height: 100%; object-fit: cover; }
.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.card-content h3 { margin-bottom: 10px; font-size: 1.2rem; }
.card-content p { color: var(--text-light); font-size: 0.9rem; }

/* STILI PER LA CARD CON ANIMAZIONE */
.typing-hero-preview { background-color: #111; color: white; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; gap: 10px; height: 100%; }
.typing-hero-preview h2 { font-size: 1.5rem; }
.typing-hero-preview .typing-container { font-size: 1rem; color: #ccc; height: 1.2em; }
.typing-hero-preview .cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.social-icons-preview { display: flex; gap: 10px; }
.social-icon-preview { width: 30px; height: 30px; border-radius: 50%; background-color: #333; display: flex; justify-content: center; align-items: center; font-size: 0.8rem; font-weight: bold; }

/* --- ABOUT & CONTACT PAGES --- */
.about-page-content, .contact-page-content { padding: 80px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 25px; }
.about-title, .contact-title { font-size: 3rem; font-weight: 800; }
.about-description-container { max-width: 800px; text-align: left; color: var(--text-light); }
.contact-description { max-width: 500px; color: var(--text-light); margin-bottom: 25px; }
.about-description-container p, .contact-description { margin-bottom: 1em; }
.about-description-container ul { list-style-position: inside; padding-left: 1em; margin-bottom: 1em; }
.about-buttons-wrapper { display: flex; gap: 20px; margin-top: 20px; }
.contact-form-container { background-color: var(--card-bg); padding: 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07); width: 100%; max-width: 600px; }
.contact-form { display: flex; flex-direction: column; gap: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 1rem; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(74, 108, 253, 0.2); }
.contact-form .button-primary { border: none; cursor: pointer; align-self: flex-start; }

/* --- FOOTER --- */
.footer { text-align: center; padding: 30px 0; background-color: #DDE1EC; color: var(--text-light); font-size: 0.9rem; }

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .nav-links, .contact-button { display: none; }
    .hamburger-menu { display: block; }
    .hero-section { padding: 40px 0; }
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-left { order: initial; }
    .hero-right { order: initial; margin-bottom: 40px; padding-left: 0; }
    .image-wrapper { width: 300px; height: 300px; }
    .hero-buttons { justify-content: center; }
    .hero-title { font-size: 2.5rem; }
    .about-buttons-wrapper { flex-direction: column; }
}