/* --- VARIABILI iOS GLASS --- */
:root {
    --ios-bg: #f5f5f7;
    --ios-text-main: #1d1d1f;
    --ios-text-sec: #86868b;
    --ios-blue: #0071e3;
    --ios-gradient: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --blur-effect: blur(25px) saturate(180%);
    --spring: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    background-color: var(--ios-bg);
    color: var(--ios-text-main);
    overflow-x: hidden;
}

/* --- NAV "DYNAMIC ISLAND" --- */
nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 12px 25px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.nav-links { display: flex; justify-content: space-around; list-style: none; }
.nav-links a {
    color: var(--ios-text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    transition: var(--spring);
}
.nav-links a:hover { background: rgba(0,0,0,0.05); }

/* --- HERO --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at top, #e0eafc 0%, var(--ios-bg) 70%);
}

.hero h1 {
    font-size: 4rem;
    letter-spacing: -0.05em;
    background: var(--ios-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p { color: var(--ios-text-sec); font-size: 1.2rem; margin-top: 15px; }

/* --- CONTAINERS & CARDS --- */
.container { max-width: 1100px; margin: 0 auto; padding: 80px 20px; }
.section-title { font-size: 2rem; margin-bottom: 30px; letter-spacing: -0.02em; }

.photo-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 25px;
    transition: var(--spring);
    box-shadow: 0 8px 32px rgba(0,0,0,0.04);
}

.photo-card:hover { transform: scale(1.02) translateY(-5px); }

/* --- COMMISSIONI STYLE --- */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.app-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 0.7rem;
}

.blue { background: linear-gradient(180deg, #5ac8fa, #007aff); }
.purple { background: linear-gradient(180deg, #af52de, #5856d6); }
.red { background: linear-gradient(180deg, #ff5e50, #ff3b30); }
.green { background: linear-gradient(180deg, #52d76b, #34c759); }
.orange { background: linear-gradient(180deg, #FFA500, #ff5e50); }
.pink { background: linear-gradient(180deg, #ffc0cb, #f0768b); }
.yellow { background: linear-gradient(180deg, #e5ea00, #c4cb21); }

/* --- CAROUSEL --- */
.carousel-wrapper { position: relative; }
.ios-carousel {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 0;
    scroll-behavior: smooth;
}
.ios-carousel::-webkit-scrollbar { display: none; }

.testimonial-card { flex: 0 0 300px; }
.stars { color: #ff9500; font-size: 0.8rem; }

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.left-arrow { left: -20px; }
.right-arrow { right: -20px; }

/* --- BUTTONS & BADGES --- */
.btn-modern {
    margin-top: 30px;
    padding: 15px 30px;
    background: var(--ios-blue);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--spring);
}

.badge {
    background: rgba(0, 113, 227, 0.1);
    color: var(--ios-blue);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- STILE SPECIFICO GALLERIA --- */
.gallery-item {
    padding: 12px; /* Ridotto per dare più spazio all'immagine */
}

.photo-wrapper {
    width: 100%;
    height: 200px;
    border-radius: 20px;
    overflow: hidden; /* Taglia l'immagine se esce dai bordi */
    margin-bottom: 12px;
}

.photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene le proporzioni riempiendo lo spazio */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-item:hover .photo-wrapper img {
    transform: scale(1.1); /* Effetto zoom fluido su hover */
}

.gallery-item p {
    font-size: 0.85rem;
    color: var(--ios-text-sec);
    text-align: center;
    font-weight: 500;
}
/* --- DOCUMENTI: ICONA PDF STILE MACOS --- */
.doc-card {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: inherit;
    padding: 20px !important;
}

.pdf-icon-macos {
    position: relative;
    width: 45px;
    height: 58px;
    background: #f4f4f4;
    border-radius: 4px;
    border: 1px solid #d1d1d1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: var(--spring);
}

/* La piega dell'angolo in alto a destra */
.pdf-fold {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 14px 14px 0;
    border-color: transparent var(--ios-bg) transparent transparent; /* Colore dello sfondo per simulare il taglio */
    z-index: 2;
}

/* L'ombreggiatura sotto la piega */
.pdf-icon-macos::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 13px;
    height: 13px;
    background: #e0e0e0;
    border-bottom-left-radius: 4px;
    border: 1px solid #d1d1d1;
    z-index: 1;
}

/* Scritta PDF rossa in basso */
.pdf-ext {
    color: #e53935;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* Effetto al passaggio del mouse sulla card */
.doc-card:hover .pdf-icon-macos {
    transform: translateY(-2px) rotate(-2deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    background: #ffffff;
}

.doc-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.doc-info p {
    font-size: 0.8rem;
    color: var(--ios-text-sec);
}
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-arrow {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--spring);
    z-index: 10;
}

.carousel-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

/* --- MODAL QUICK LOOK --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 245, 247, 0.8); /* Colore iOS con trasparenza */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 80vh;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.9);
    animation: zoomIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: var(--ios-text-main);
    padding: 20px 0;
    font-weight: 600;
    font-size: 1.2rem;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--ios-text-main);
    font-size: 40px;
    font-weight: 200;
    cursor: pointer;
    transition: 0.3s;
}

/* Rendi le foto cliccabili */
.gallery-item .photo-wrapper {
    cursor: pointer;
}
/* Regole specifiche per la spaziatura del testo nei progetti */
.project-main h2 {
    margin-top: 15px;
    margin-bottom: 20px;
}

.project-main p {
    margin-bottom: 15px; /* Crea spazio tra un paragrafo e l'altro */
    line-height: 1.6;    /* Aumenta lo spazio tra le righe di testo per una lettura migliore */
    font-size: 1.05rem;
}

.project-main p:last-child {
    margin-bottom: 0; /* Rimuove il margine extra dopo l'ultimo paragrafo */
}
.photo-card p {
    text-align: justify;
    hyphens: auto; /* Opzionale: aiuta a gestire gli spazi bianchi spezzando le parole lunghe */
}
/* --- FOOTER CREDITS --- */
footer {
    padding: 60px 20px 40px; /* Più spazio sopra per distanziarlo dai documenti */
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.3); /* Un leggero tocco glass */
    margin-top: 50px;
}

footer p {
    color: var(--ios-text-sec);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

footer strong {
    color: var(--ios-text-main);
    font-weight: 600;
}