/* ==========================================================================
   1. RESET E BASI
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
}

/* ==========================================================================
   2. HEADER E TIPOGRAFIA
   ========================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;              
    margin: 4rem auto;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

header nav ul a {
    text-decoration: none;
    color: #111;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.125rem;
    transition: color 0.3s ease;  
}

header nav ul li a:hover { color: #0059FF; }

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

h1 { font-size: 4rem; }
h2 { font-size: 2.25rem; }

p {
    font-family: 'Lato', sans-serif;
    font-size: 1.5625rem; 
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: #111;
}

/* ==========================================================================
   3. HERO (Sfondo Grigio #F9F9F9)
   ========================================================================== */
.hero-wrapper {
    background-color: #f9f9f9;
    width: 100%;
}

.hero {
    display: flex;
    align-items: stretch; 
    flex-wrap: wrap;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 0;
}

.hero-text { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.hero-image img {
    height: 100%; 
    max-height: 450px;
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
    border: 1px solid black;
    object-fit: cover;
}

.special-text {
    color: #0059FF;
    font-style: italic;
    font-size: 2rem;
    font-weight: 1000;
}

.btn-primario {
    display: inline-block;
    background-color: #0059FF;
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    transition: 0.3s ease;
}

.btn-secondario {
    display: inline-block;
    padding: 1rem 2rem;
    border: 1px solid #111;
    color: #111;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: 0.3s ease;
}

.btn-secondario:hover { background-color: #0059FF; color: white; border-color: #0059FF; }

/* ==========================================================================
   4. SEZIONE PROGETTI
   ========================================================================== */
.projects {
    max-width: 1200px;
    margin: 4rem auto;
    padding-bottom: 4rem;
}

.portfolio-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }

.view-all {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-all .arrow { transition: transform 0.3s ease; }
.view-all:hover .arrow { transform: translateX(6px); }

.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

.categoria { color: #393939; font-size: 1.125rem; font-weight: 1000; }

.projects-card-grande, .projects-card {
    background: #fff;
    border: 2px solid #111;
    border-radius: 24px;
    padding: 3rem;
    display: flex;
    overflow: hidden;
    align-items: center;
}

.projects-card-grande { grid-column: span 2; }

.card-img img {
    max-width: 100%;
    transform: rotate(-10deg) translateY(20px); 
}

/* ==========================================================================
   5. JOURNEY PREVIEW
   ========================================================================== */
.journey-preview {
    background-color: #f9f9f9; /* Grigio come la Hero */
    padding: 8rem 2rem;
    color: #111111; /* Testo Nero */
}

.journey-container { max-width: 700px; margin: 0 auto; text-align: left; }

.journey-container strong { color: #0059FF; }

.journey-preview h2, 
.journey-preview p, 
.journey-preview .view-all { 
    color: #111111; 
}

/* ==========================================================================
   6. FOOTER 
   ========================================================================== */
.footer {
    background-color: #ffffff; 
    color: #111111;
    transition: background-color 0.8s ease, color 0.6s ease;
    padding: 8rem 2rem;
    text-align: center;
}

/* Stato attivo quando scrolli */
.footer.is-active {
    background-color: #001524; /* Blu Navy */
    color: #ffffff;
}

.footer.is-active h1, 
.footer.is-active h2 a,
.footer.is-active .social-item { color: #ffffff; }

.footer.is-active .social-icona { border: 1px solid #ffffff; border-radius: 20px; }

.social-link { list-style: none; display: flex; justify-content: center; gap: 2rem; margin-top: 8rem; }
.social-item { display: flex; align-items: center; gap: 0.5rem; text-decoration: underline; color: #111; font-weight: 700; transition: 0.3s; }
.social-item:hover { color: #0059FF; }
.social-icona { width: 36px; height: 36px; }

/* ==========================================================================
   7. PAGINA ALL PROJECTS
   ========================================================================== */
.projects-page { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* La griglia deve essere pronta a ricalcolarsi */
.projects-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem 2rem;
    transition: all 0.3s ease; /* Aiuta a rendere il riposizionamento meno brusco */
}

.mini-card {
    display: flex;
    flex-direction: column;
    /* Animiamo solo l'opacità quando la card compare */
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    transform: translateY(0);
    gap: 1.5rem;
}

/* Quando la card deve entrare, parte da qui */
.mini-card.coming-in {
    opacity: 0;
    transform: translateY(20px); /* Un piccolo effetto dal basso verso l'alto */
}

.mini-card-img { background: #f4f4f4; border: 2px solid #111; border-radius: 20px; overflow: hidden; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; }
.mini-card-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s ease; }



.filter-container{
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.filter-btn{
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    border: 1px solid #111;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover{
    background: #0059FF;
    color: #fff;
    border-color: #0059FF;

}

.filter-btn.active {
    background-color: #0059FF;
    border-color: #0059FF;
    color: white;
}

/* ==========================================================================
   8. PAGINA CASE STUDY
   ========================================================================== */


.cs-header {
    position: absolute; /* Fondamentale per stare sopra l'immagine */
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    z-index: 10; /* Lo tiene in primo piano */
}

.back-link {
    text-decoration: none;
    color: #111;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs-hero-full {
    position: relative;
    width: 100%;
    height: 50vh; 
    overflow: hidden;
    border-bottom-left-radius: 60px; /* Bordi rotondi solo sotto */
    border-bottom-right-radius: 60px;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* L'immagine non si schiaccia */
}

/* Il gradiente nero verso il basso per leggere il testo */

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
                rgba(0,0,0,0.4) 0%, 
                transparent 50%, 
                rgba(0,0,0,0.6) 100%);
    display: flex;
    flex-direction: column; /* Mette categoria sopra e titolo sotto */
    justify-content: center; /* Centra verticalmente */
    align-items: center;     /* Centra orizzontalmente */
    text-align: center;      /* Allinea il testo nel mezzo */
    padding: 2rem;
}


.hero-text-container h1 {
    color: #111;
    font-size: 4rem;
    margin: 0;
}

.categoria-white {
    color: #111;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: 'Poppins', sans-serif;
}

/* Contenitore centrale per non far andare il testo da un bordo all'altro */
.case-study-wrapper {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.project-details {
    display: flex;
    justify-content: space-between;
    padding-bottom: 3rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 3rem;
}

.detail-item span {
    font-weight: 700;
    color: #0059FF; 
    text-transform: uppercase;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.5rem;
}

.cs-hero-full {
    position: relative; width: 100%; height: 60vh; overflow: hidden;
    border-bottom-left-radius: 60px; border-bottom-right-radius: 60px;
    margin-bottom: 60px;
}
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
    display: flex; justify-content: center; align-items: center; text-align: center;
}
.hero-overlay h1 { color: #fff; font-size: 4.5rem; }


/* --- GRID META (Role/Timeline/Tools) --- */
.project-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 colonne identiche */
    width: 100%;                        /* Occupa tutto il wrapper */
    padding: 60px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 100px;
}

.meta-col.align-left { 
    text-align: left; 
}

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

.meta-col.align-right { 
    text-align: right; 
}

.meta-col .value { 
    font-size: 24px; 
    font-weight: 500; 
    color: #111; 
    margin: 0;
    font-family: 'Poppins', sans-serif;

}

/* Label Blu sopra i valori */
.label {
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #0059FF;
    margin-bottom: 10px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;

}

/* About as Statement (Citazione) */
.project-statement {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 120px auto;
}

.project-statement p {
    font-size: 1.5rem;
    line-height: 1.2;
    color: #111;
    text-align: left;
}

/* Strategy Cards */
.strategy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 150px;
}
.strategy-card {
    background: #F8FAFF;
    padding: 40px;
}
.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.strategy-card p { font-size: 1.2rem; color: #444; }

/* ==========================================================================
   4. PROCESS INTERACTIVE (Correzione Linea)
   ========================================================================== */
.process-interactive { display: flex; gap: 80px; position: relative; isolation: isolate; }

.process-sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 60px; height: fit-content; }

.serpentine-line {
    position: absolute;
    left: 25px; top: 25px; bottom: 85px;
    width: 2px;
    border-left: 2px dashed #ccc;
    z-index: -1;
}

.step-nav { display: flex; align-items: center; margin-bottom: 60px; cursor: pointer; position: relative; }

.step-dot {
    width: 50px; height: 50px;
    background-color: #fff;
    border: 2px solid rgba(17,17,17, 0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; margin-right: 20px;
    z-index: 10; position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.step-nav.active .step-dot {
    transform: scale(1.3);
    background-color: #0059FF;
    border-color: #0059FF;
    color: #fff;
}

.step-label { font-size: 1.2rem; font-weight: 700; opacity: 0.3; transition: 0.4s; }
.step-nav.active .step-label { opacity: 1; color: #0059FF; transform: scale(1.1); }

.process-display { flex-grow: 1; }

.step-content h2{
    font-size: 3rem;       /* Molto grande per dare importanza */
    color: #111;
    margin-bottom: 4rem; 
    font-weight: 700;
}

.step-content h3{
    font-size: 1.25rem;    /* Più piccolo dell'H2 */
    color: #0059FF;        /* Colore blu per differenziarlo */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem; /* Molto spazio sotto per separare dai paragrafi */
    font-weight: 600;
}

.image-block {
    display: flex;      /* Le mette affiancate */
    gap: 20px;          /* Spazio tra le due immagini (puoi metterlo a 0 se le vuoi attaccate) */
    width: 100%;        /* Occupa tutta la larghezza del div padre */
}

.image-block img {
    flex: 1;            /* Forza le immagini a essere grandi uguali e occupare tutto lo spazio */
    width: 50%;         /* Base di partenza */
    height: auto;       /* Mantiene le proporzioni originali senza schiacciarle */
    display: block;
}

.strategy-card{
    margin-top: 2rem;
}