/* Modern minimalist design - Domenico Caiazza */

:root {
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;
    /* Google Gemini style - bianco/grigio */
    --color-bg: #FFFFFF;
    --color-bg-alt: #F8F9FA;
    --color-text: #202124;
    --color-text-muted: #5F6368;
    --color-accent: #264b6e;
    --color-accent-soft: rgba(38, 75, 110, 0.12);
    --color-border: #E8EAED;
    /* CTA button - preserved from original */
    --cta-gradient: linear-gradient(45deg, #495057, #264b6e, #5fa15a);
    --cta-gradient-hover: linear-gradient(45deg, #3d4550, #1e3a52, #4d8a47);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    margin: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

/* Section titles */
.section-title {
    font-family: var(--font-sans);
    font-weight: 600;
}

/* Span con colore di accento per enfasi */
.accent {
    color: var(--color-accent);
    font-weight: 700;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.site-header.scrolled {
    border-color: var(--color-border);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text) !important;
}

.navbar-nav .nav-link {
    color: var(--color-text-muted) !important;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
}

.navbar-nav .nav-link:hover {
    color: var(--color-text) !important;
}

.navbar-toggler {
    border-color: var(--color-border);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(64, 138, 61, 0.2);
}

.nav-close {
    display: none;
}

/* Mobile menu - modern full-screen overlay */
@media (max-width: 991px) {
    .navbar-toggler.nav-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 1px solid var(--color-border);
        border-radius: 8px;
        background: #fff;
        overflow: visible;
    }

    .navbar-toggler.nav-toggle:hover {
        background: var(--color-bg-alt);
    }

    .navbar-toggler.nav-toggle .navbar-toggler-icon {
        display: none !important;
    }

    .nav-toggle-bar {
        display: block !important;
        width: 22px;
        height: 2px;
        background-color: #202124 !important;
        border-radius: 1px;
        transition: transform 0.3s ease, opacity 0.3s ease;
        flex-shrink: 0;
    }

    .navbar-toggler.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .navbar-toggler.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }

    .navbar-toggler.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .navbar-collapse {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 5rem 1.5rem 2rem !important;
        background-color: #ffffff !important;
        z-index: 999;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        overflow-y: auto;
    }

    .navbar-collapse.collapse:not(.show) {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .navbar-collapse.collapse.show {
        opacity: 1;
        visibility: visible;
        background-color: #ffffff !important;
    }

    .nav-close {
        display: flex;
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: var(--color-bg-alt);
        color: var(--color-text);
        font-size: 1.75rem;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
    }

    .nav-close:hover {
        background: var(--color-border);
    }

    .nav-close span {
        margin-top: -2px;
    }

    .navbar-collapse .navbar-nav {
        width: 100%;
        max-width: 320px;
        margin: 0 auto !important;
        padding: 0 1.5rem;
        flex-direction: column;
        gap: 0;
        text-align: center;
        align-items: stretch;
        list-style: none;
    }

    .navbar-collapse .nav-item {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
        flex: 0 0 auto;
    }

    .navbar-collapse .nav-item:last-of-type {
        border-bottom: none;
    }

    .navbar-collapse .nav-link {
        display: block;
        padding: 1rem 0 !important;
        font-size: 1.25rem !important;
        font-weight: 600;
        color: var(--color-text) !important;
        text-align: center;
    }

    .navbar-collapse .nav-item-cta {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--color-border);
    }

    .navbar-collapse .nav-item-cta .btn-cta {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

}

/* CTA Button */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    background: var(--cta-gradient);
    background-size: 200% 200%;
    animation: cta-gradient 8s ease infinite;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-cta:hover {
    color: #fff !important;
    transform: scale(1.02);
    filter: brightness(1.08);
}

.btn-cta img {
    flex-shrink: 0;
}

@keyframes cta-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text) !important;
    text-decoration: none !important;
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    transition: border-color 0.2s, background 0.2s;
}

.btn-ghost:hover {
    border-color: var(--color-accent);
    background: rgba(64, 138, 61, 0.04);
}

/* Hero */
.hero {
    padding: 8rem 0 6rem;
    min-height: 100vh;
}

.min-vh-75 {
    min-height: 75vh;
}

.hero-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1rem;
    font-weight: 400;
}

.hero-title em {
    font-family: var(--font-serif);
    font-style: italic;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.hero-subtitle-arrow {
    color: #5fa15a;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 32rem;
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-avatar {
    width: 100%;
    max-width: 320px;
    border-radius: 50%;
    box-shadow: 0 24px 48px rgba(0,0,0,0.08);
}

/* Sections */
.section {
    padding: 5rem 0;
}

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

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* Links */
a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* About */
.lead-text {
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.social-links a:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(64, 138, 61, 0.06);
    text-decoration: none;
}

/* Projects Carousel */
#projectsCarousel .carousel-item {
    height: 400px;
}

.project-slide {
    height: 100%;
    padding: 2rem;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.project-slide .col-md-5 a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.project-image:hover {
    transform: scale(1.02);
}

.project-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.project-title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.project-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border: 1px solid rgba(38, 75, 110, 0.25);
    border-radius: 1rem;
}

.project-description {
    color: var(--color-text-muted);
    margin: 0;
}

/* Project carousel - labeled tabs (outside Bootstrap indicators) */
.projects-carousel-wrapper {
    position: relative;
}

.carousel-labels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.carousel-label-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
    text-align: left;
}

.carousel-label-btn:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.carousel-label-btn.active {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    box-shadow: 0 0 0 1px var(--color-accent);
}

.carousel-label-btn::after {
    content: '';
    position: absolute;
    bottom: 0.4rem;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--color-border);
    border-radius: 1px;
    transition: background 0.2s;
}

.carousel-label-btn.active::after {
    background: var(--color-accent);
}

.carousel-label-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
    line-height: 1.2;
}

.carousel-label-btn.active .carousel-label-text {
    color: var(--color-accent);
}

.carousel-label-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    opacity: 0.8;
}

.carousel-label-btn.active .carousel-label-sub {
    color: var(--color-accent);
    opacity: 0.9;
}

/* Carousel arrows - visible only on mobile */
.carousel-arrows-mobile {
    display: none;
}

@media (max-width: 991px) {
    .carousel-labels {
        display: none;
    }

    .carousel-arrows-mobile {
        display: flex;
        width: 48px;
        height: 48px;
        top: -3.5rem;
        transform: none;
        bottom: auto;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid var(--color-border);
        border-radius: 50%;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        z-index: 10;
    }

    .carousel-arrows-mobile:hover {
        background: var(--color-bg-alt);
        border-color: var(--color-accent);
    }

    .carousel-arrows-mobile .carousel-control-prev-icon,
    .carousel-arrows-mobile .carousel-control-next-icon {
        filter: invert(1);
        opacity: 0.7;
    }

    .carousel-arrows-mobile.carousel-control-prev {
        left: 0.5rem;
    }

    .carousel-arrows-mobile.carousel-control-next {
        right: 0.5rem;
    }
}

/* Stacked layout: align arrows with title (below image) */
@media (max-width: 575px) {
    .carousel-arrows-mobile {
        top: 9.5rem;
    }
}

/* Projects grid */
.projects-grid-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.project-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none !important;
    color: var(--color-text);
    transition: transform 0.2s;
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.project-card-label {
    display: block;
    padding: 0.75rem 0.75rem 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    background: #fff;
}

.project-card-features {
    display: block;
    padding: 0 0.75rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    background: #fff;
}

.project-card:hover .project-card-label,
.project-card:hover .project-card-features {
    color: var(--color-accent);
}

/* Timeline */
.timeline {
    max-width: 640px;
    margin: 0 auto;
}

.timeline-item {
    padding-bottom: 2.5rem;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2.5rem;
    bottom: 0;
    width: 1px;
    background: var(--color-border);
}

.timeline-content {
    padding-left: 2rem;
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.timeline-header h4 {
    font-size: 1.1rem;
    margin: 0;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 500;
}

.timeline-company {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin: 0.25rem 0 0.5rem;
}

.timeline-content p {
    margin: 0 0 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-stack img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0.8;
}

.tech-stack img:hover {
    opacity: 1;
}

/* Contact form (legacy - kept for compatibility) */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(64, 138, 61, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Contact chatbot - 2026 style */
.contact-chat {
    background: var(--color-bg);
    border-radius: 20px;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-bg-alt);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.chat-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}

.chat-status {
    font-size: 0.8rem;
    color: #5a8a5a;
}

.chat-messages {
    padding: 1.5rem;
    min-height: 220px;
}

.msg {
    max-width: 92%;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(8px);
    animation: msgIn 0.4s ease forwards;
}

.msg-bot {
    background: var(--color-bg-alt);
    padding: 0.9rem 1.2rem;
    border-radius: 18px 18px 18px 4px;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.msg-bot span {
    display: block;
}

@keyframes msgIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg[data-delay="400"] { animation-delay: 0.4s; }
.msg[data-delay="800"] { animation-delay: 0.8s; }

.msg-choices {
    padding: 0.5rem 0;
}

.chat-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chat-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.chat-action-btn:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.chat-action-btn i {
    font-size: 1.1rem;
    color: var(--color-accent);
}

.chat-action-btn.chat-action-write {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.chat-action-btn.chat-action-write:hover {
    background: #1e3a52;
    border-color: #1e3a52;
}

.chat-action-btn.chat-action-write i {
    color: #fff;
}

/* Chat form (revealed on "Scrivimi") */
.chat-form-wrap {
    margin-top: 1rem;
}

.chat-form-wrap .msg-bot {
    margin-bottom: 1.25rem;
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group-chat {
    width: 100%;
}

.form-control-chat {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control-chat:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.form-control-chat::placeholder {
    color: var(--color-text-muted);
}

.chat-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--cta-gradient);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 75, 110, 0.3);
}

.chat-send-btn i {
    font-size: 0.9rem;
}

.chat-form-wrap .h-captcha {
    margin-bottom: 0.25rem;
}

/* Footer */
.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-content a {
    font-weight: 600;
    color: var(--color-text);
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

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

.footer-copy {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* Responsive */
@media (max-width: 991px) {
    .hero {
        padding: 6rem 0 4rem;
    }

    .hero-avatar {
        max-width: 220px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 575px) {
    .hero-avatar {
        max-width: 160px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn-cta, .btn-ghost {
        justify-content: center;
    }

    .project-slide .col-md-5 {
        order: -1;
    }

    #projectsCarousel .carousel-item {
        height: auto;
        min-height: 520px;
    }

    .project-slide .col-md-5 a {
        height: 260px;
    }
}

