/*
 * So Fab Studio: foglio di stile unico del tema.
 * Bootstrap (assets/bootstrap) fornisce griglia, offcanvas e utility;
 * qui ci sono font, colori, componenti e pagine. I testi legali e il
 * banner cookie stanno in cookie-banner.css, il modulo preventivo in preventivo.css.
 */

/* ---------- Font ---------- */
@font-face { font-family: 'Peanut Donuts'; src: url(../fonts/PeanutDonutsRegular.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/SpaceGrotesk-Light.woff2) format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/SpaceGrotesk-Regular.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/SpaceGrotesk-Medium.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/SpaceGrotesk-SemiBold.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(../fonts/SpaceGrotesk-Bold.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- Token ---------- */
:root {
    --sf-yellow: #FFB900;
    --sf-pink: #FFB0B5;
    --sf-cream: #FBECE2;
    --sf-ink: #171717;
    --sf-line: 2px solid var(--sf-ink);
    --sf-radius: 22px;
    --sf-radius-sm: 14px;
    --sf-display: 'Peanut Donuts', 'Space Grotesk', sans-serif;
    --sf-text: 'Space Grotesk', system-ui, sans-serif;
    --sf-section: clamp(56px, 8vw, 112px);
    --sf-header: 106px;
    /* Altezza della fascia che scorre (padding, testo e bordi): serve alla prima schermata */
    --sf-marquee: calc(1.8rem + clamp(1.8rem, 4vw, 3.2rem) + 4px);
    --bs-body-font-family: var(--sf-text);
    --bs-body-color: var(--sf-ink);
    --bs-body-bg: var(--sf-yellow);
    --bs-emphasis-color: var(--sf-ink);
    --bs-link-color: var(--sf-ink);
    --bs-link-hover-color: var(--sf-ink);
    --bs-link-color-rgb: 23, 23, 23;
    --bs-link-hover-color-rgb: 23, 23, 23;
}

/* ---------- Base ---------- */
/* Bootstrap attiva scroll-behavior: smooth su :root: all'apertura di una pagina
   con #sezione farebbe partire la pagina dall'alto e la farebbe scorrere.
   Lo spegniamo; lo scorrimento morbido dei link interni lo gestisce assets/js/site.js. */
:root { scroll-behavior: auto; }
body.site {
    margin: 0;
    background: var(--sf-yellow);
    color: var(--sf-ink);
    font-family: var(--sf-text);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
[id] { scroll-margin-top: calc(var(--sf-header) + 16px); }
img { max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--sf-ink); color: var(--sf-yellow); }
:focus-visible { outline: 3px solid var(--sf-ink); outline-offset: 4px; }

.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1100; padding: 12px 16px; border: var(--sf-line); border-radius: 12px; background: var(--sf-cream); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

.display, .section-title, .page-title {
    font-family: var(--sf-display);
    font-weight: 400;
    line-height: 1.08;
    overflow-wrap: anywhere;
}
.section-title { font-size: clamp(2rem, 4.2vw, 2.9rem); margin: 0 0 1.25rem; }
.page-title { font-size: clamp(2.8rem, 7vw, 6rem); margin: 0 0 1.5rem; }
.eyebrow { margin: 0 0 .75rem; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.lead-text { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.55; max-width: 40rem; }

/* Testi editoriali (richtext) */
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }
.prose a { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--sf-pink); }

/* ---------- Pulsanti ---------- */
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: .6em;
    padding: 13px 28px;
    border: var(--sf-line);
    border-radius: 999px;
    background: var(--sf-pink);
    color: var(--sf-ink);
    font-family: var(--sf-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn-pill:hover { color: var(--sf-ink); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--sf-ink); }
.btn-pill:active { transform: none; box-shadow: none; }
.btn-pill--light { background: var(--sf-cream); }

/* ---------- Header ---------- */
.site-header {
    --bs-navbar-padding-y: .75rem;
    --bs-navbar-color: var(--sf-ink);
    --bs-navbar-hover-color: var(--sf-ink);
    --bs-navbar-active-color: var(--sf-ink);
    background: var(--sf-yellow);
    font-family: var(--sf-text);
    min-height: var(--sf-header);
    transition: box-shadow .2s ease;
}
.site-header .navbar-brand img { display: block; width: 9rem; height: auto; }
.site-header .nav-link { color: var(--sf-ink); font-size: 1rem; font-weight: 600; letter-spacing: .01em; padding: .25rem .1rem; white-space: nowrap; }
.site-header .nav-link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.site-header .navbar-toggler { border: 0; padding: 0; }
.site-header .navbar-toggler:focus { box-shadow: none; }
.site-header .navbar-toggler:focus-visible { outline: 3px solid var(--sf-ink); outline-offset: 4px; }
.site-header .offcanvas { --bs-offcanvas-bg: var(--sf-yellow); --bs-offcanvas-color: var(--sf-ink); }
.site-header .btn-close:focus { box-shadow: none; }
.social-links { display: flex; align-items: center; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.social-links a { display: inline-flex; color: var(--sf-ink); transition: transform .2s ease; }
.social-links a:hover { transform: translateY(-2px); }
.social-links svg { width: 1.3em; height: 1.3em; }
.lang-switch { display: flex; align-items: center; gap: .5rem; font-family: var(--sf-text); font-weight: 700; font-size: .9rem; }
.lang-btn { padding: 0; border: 0; background: none; color: var(--sf-ink); font: inherit; opacity: .5; cursor: pointer; }
.lang-btn:hover, .lang-btn.active { opacity: 1; }
.lang-btn.active { text-decoration: underline; text-underline-offset: 4px; }
.lang-separator { opacity: .4; }
@media (max-width: 1199.98px) {
    .site-header .nav-link { font-size: 1.5rem; }
    .site-header .offcanvas-body { padding-bottom: 3rem; }
}

/* ---------- Sezioni ---------- */
.section { padding: var(--sf-section) 0; }
.section--tight-top { padding-top: 0; }
.section-head { max-width: 46rem; margin-bottom: 2.5rem; }
.split { display: grid; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (min-width: 768px) {
    .split { grid-template-columns: 1fr 1fr; }
    .split--reverse > :first-child { order: 2; }
}
.illustration { display: block; width: 100%; max-width: 520px; margin-inline: auto; }
@media (max-width: 767.98px) { .illustration { max-width: 300px; } }

/* Le illustrazioni si muovono al passaggio del mouse */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .wiggle:hover { animation: sf-wiggle .6s ease; }
    .bounce:hover { animation: sf-bounce .6s ease; }
}
@keyframes sf-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-1.5deg); } }
@keyframes sf-bounce { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.04); } 70% { transform: scale(.98); } }

.hero { padding-top: clamp(24px, 4vw, 48px); }
.hero .btn-pill { margin-top: 1.75rem; }
/* H1 per Google: piccolo sopra "chi sono?", che resta il titolo grande */
.hero-kicker { font-family: var(--sf-text); line-height: 1.4; }
/* Da tablet in su presentazione e fascia che scorre stanno insieme nella prima schermata */
@media (min-width: 768px) {
    .hero { display: flex; align-items: center; min-height: calc(100svh - var(--sf-header) - var(--sf-marquee)); padding-block: clamp(16px, 3vh, 40px); }
    .hero > .container { width: 100%; }
    .hero .illustration { width: auto; max-height: calc(100svh - var(--sf-header) - var(--sf-marquee) - clamp(32px, 6vh, 80px)); }
    .hero .btn-pill { margin-top: clamp(1rem, 2.5vh, 1.75rem); }
}

/* Fascia che scorre */
.marquee { overflow: hidden; border-block: var(--sf-line); background: var(--sf-cream); padding: .9rem 0; }
.marquee__track { display: flex; width: max-content; animation: sf-marquee 28s linear infinite; }
/* Peanut Donuts ha la discendente piu alta del necessario: le maiuscole si spostano giu per stare al centro della fascia */
.marquee__track span { display: block; font-family: var(--sf-display); font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 1; white-space: nowrap; padding-right: 2rem; transform: translateY(.13em); }
@keyframes sf-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* ---------- Filtri progetti ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 2rem; }
.filter-btn {
    padding: 7px 18px;
    border: var(--sf-line);
    border-radius: 999px;
    background: transparent;
    color: var(--sf-ink);
    font-family: var(--sf-text);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .2s ease;
}
.filter-btn:hover { background: var(--sf-cream); }
.filter-btn.filter-active { background: var(--sf-ink); color: var(--sf-yellow); }

/* ---------- Schede (progetti e siti) ---------- */
/* Progetti: schede compatte, 2 per riga sul telefono, 3 su tablet, 4 da portatile in su */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1200px) { .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }
.sf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: var(--sf-line);
    border-radius: var(--sf-radius);
    background: var(--sf-cream);
    transition: transform .2s ease, box-shadow .2s ease;
}
.sf-card:hover, .sf-card:focus-within { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--sf-ink); }
.sf-card__media { position: relative; border-bottom: var(--sf-line); background: var(--sf-pink); }
.sf-card__media > img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.sf-card__body { display: flex; flex: 1; flex-direction: column; padding: 22px 24px 24px; overflow-wrap: anywhere; }
.sf-card__title { margin: 0 0 .5rem; font-family: var(--sf-text); font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.sf-card__title a { text-decoration: none; }
.sf-card__text { margin: 0 0 1.25rem; font-size: .95rem; line-height: 1.55; }
.sf-card__more { display: inline-flex; gap: .5rem; align-self: flex-start; margin-top: auto; padding-bottom: 2px; border-bottom: var(--sf-line); font-weight: 700; font-size: .95rem; }
.sf-card .eyebrow { margin-bottom: .5rem; }
/* Schede compatte (progetti e anteprima siti in homepage): tutta la scheda e il link */
.card-grid .sf-card, .site-grid .sf-card { border-radius: 18px; }
.card-grid .sf-card__body, .site-grid .sf-card__body { padding: 14px 16px 16px; }
.card-grid .eyebrow, .site-grid .eyebrow { margin-bottom: .35rem; font-size: .68rem; letter-spacing: .1em; }
.card-grid .sf-card__title, .site-grid .sf-card__title { margin-bottom: .3rem; font-size: 1.1rem; }
.card-grid .sf-card__text, .site-grid .sf-card__text { display: -webkit-box; margin: 0; overflow: hidden; font-size: .85rem; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-grid .sf-card__more, .site-grid .sf-card__more { display: none; }
@media (max-width: 575.98px) {
    .card-grid .sf-card { border-radius: 14px; }
    .card-grid .sf-card__body { padding: 10px 12px 12px; }
    .card-grid .sf-card__title { margin: 0; font-size: .98rem; line-height: 1.2; }
    .card-grid .sf-card__text { display: none; }
    .card-grid .eyebrow { font-size: .6rem; }
}

/* Anteprima di un sito: barra del browser, screenshot desktop e, se c'e, telefono */
.site-grid { display: grid; gap: 20px; }
/* Homepage: i primi quattro siti, nell'ordine della lista; sul telefono scorrono di lato */
.site-grid--teaser > :nth-child(n+5) { display: none; }
@media (min-width: 768px) { .site-grid--teaser { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .site-grid--teaser { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }
@media (max-width: 767.98px) {
    .site-grid--teaser { grid-auto-flow: column; grid-auto-columns: 80%; gap: 14px; margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -.5); padding: 4px calc(var(--bs-gutter-x, 1.5rem) * .5) 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: calc(var(--bs-gutter-x, 1.5rem) * .5); scrollbar-width: none; }
    .site-grid--teaser::-webkit-scrollbar { display: none; }
    .site-grid--teaser > * { scroll-snap-align: start; }
}
/* Pagina siti web: un'unica riga che scorre di lato, la categoria sotto l'anteprima */
.site-row { position: relative; }
/* Lo snap e "di prossimita": aggancia la scheda vicina senza bloccare il trackpad;
   overscroll-behavior evita che lo swipe a fine riga faccia tornare indietro il browser */
.site-grid--row { grid-auto-flow: column; grid-auto-columns: min(82%, 400px); gap: 22px; margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -.5); padding: 6px calc(var(--bs-gutter-x, 1.5rem) * .5) 18px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: calc(var(--bs-gutter-x, 1.5rem) * .5); scrollbar-width: thin; scrollbar-color: var(--sf-ink) transparent; -webkit-overflow-scrolling: touch; }
.site-grid--row > * { scroll-snap-align: start; }
/* Col mouse la riga si trascina; durante il trascinamento niente snap e niente selezione del testo */
@media (hover: hover) and (pointer: fine) { .site-grid--row { cursor: grab; } }
.site-grid--row.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.site-grid--row.is-dragging a { pointer-events: none; }
.site-grid--row img { -webkit-user-drag: none; user-select: none; }
.site-grid--row .eyebrow { margin-bottom: .15rem; font-family: var(--sf-display); font-size: 1.45rem; font-weight: 400; letter-spacing: 0; line-height: 1.1; text-transform: none; }
.site-grid--row .sf-card__title { font-size: .95rem; font-weight: 600; }
/* Frecce ai lati della riga, all'altezza delle anteprime (solo con mouse) */
.site-row__nav { position: absolute; top: clamp(96px, 11vw, 150px); left: 0; right: 0; display: flex; justify-content: space-between; margin: 0 calc(var(--bs-gutter-x, 1.5rem) * -.5 - 10px); pointer-events: none; }
.site-row__nav button { display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; border: var(--sf-line); border-radius: 50%; background: var(--sf-cream); color: var(--sf-ink); font-size: 1.1rem; font-weight: 700; box-shadow: 3px 3px 0 var(--sf-ink); cursor: pointer; pointer-events: auto; transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease; }
.site-row__nav button:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--sf-ink); }
.site-row__nav button:disabled { opacity: 0; pointer-events: none; }
.site-row__nav:not(.is-ready) { display: none; }
@media (hover: none), (pointer: coarse) { .site-row__nav { display: none; } }
.browser-bar { display: flex; gap: 6px; padding: 12px 16px; border-bottom: var(--sf-line); background: var(--sf-pink); }
.browser-bar span { width: 9px; height: 9px; border: 1.5px solid var(--sf-ink); border-radius: 50%; }
.site-shot { position: relative; background: #fff; }
.site-shot__desktop { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }
.site-shot__placeholder { display: grid; place-items: center; aspect-ratio: 16 / 10; padding: 24px; background: var(--sf-pink); font-family: var(--sf-display); font-size: clamp(1.5rem, 3vw, 2.6rem); text-align: center; }
.site-shot__phone {
    position: absolute;
    right: 5%;
    bottom: 7%;
    width: 22%;
    margin: 0;
    padding: 3px;
    border: var(--sf-line);
    border-radius: 14px;
    background: var(--sf-ink);
    box-shadow: 4px 4px 0 rgba(23, 23, 23, .35);
}
/* Screenshot lungo: il sito scorre da solo nella finestra, avanti e indietro */
.site-shot__desktop--scroll { object-position: 50% 0; }
@media (prefers-reduced-motion: no-preference) {
    .site-shot__desktop--scroll { animation: sf-shot-scroll 16s ease-in-out infinite alternate; }
    .site-grid > :nth-child(2n) .site-shot__desktop--scroll { animation-duration: 19s; animation-delay: -4s; }
    .site-grid > :nth-child(3n) .site-shot__desktop--scroll { animation-duration: 14s; animation-delay: -8s; }
}
@keyframes sf-shot-scroll { 0%, 10% { object-position: 50% 0; } 90%, 100% { object-position: 50% 100%; } }

/* Schede progetto: le foto extra si alternano sull'immagine principale, come una gif */
.sf-card__media { overflow: hidden; }
.sf-card__slides { position: absolute; inset: 0; pointer-events: none; }
.sf-card__slides:not(:has(img)) { display: none; }
.sf-card__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
/* Ogni scheda parte con un ritardo diverso (--sf-lag), cosi le foto non cambiano tutte insieme */
.card-grid > :nth-child(5n+2) { --sf-lag: 2.4s; }
.card-grid > :nth-child(5n+3) { --sf-lag: .9s; }
.card-grid > :nth-child(5n+4) { --sf-lag: 3.4s; }
.card-grid > :nth-child(5n+5) { --sf-lag: 1.6s; }
/* Ogni foto resta 4 secondi; la successiva entra in dissolvenza (1,3 s) sopra la precedente,
   che sparisce solo quando e gia coperta: nessun lampo dell'immagine sotto */
@media (prefers-reduced-motion: no-preference) {
    .sf-card__slide { animation: sf-card-slide 16s ease-in-out infinite; animation-delay: calc(4s + var(--sf-lag, 0s)); }
    .sf-card__slide:nth-child(2) { animation-delay: calc(8s + var(--sf-lag, 0s)); }
    .sf-card__slide:nth-child(3) { animation-delay: calc(12s + var(--sf-lag, 0s)); }
    .sf-card__slide:nth-child(n+4) { display: none; }
    /* L'ultima foto torna all'immagine principale: sfuma alla fine del suo turno */
    .sf-card__slide:last-child { animation-name: sf-card-slide-last; }
    /* Due foto: giro da 12 secondi; una foto sola: giro da 8 */
    .sf-card__slides:has(> :nth-child(2):last-child) .sf-card__slide { animation-duration: 12s; animation-name: sf-card-slide-12; }
    .sf-card__slides:has(> :nth-child(2):last-child) .sf-card__slide:last-child { animation-name: sf-card-slide-12-last; }
    .sf-card__slide:only-child { animation-duration: 8s; animation-name: sf-card-slide-8; }
}
@keyframes sf-card-slide { 0% { opacity: 0; } 8%, 33% { opacity: 1; } 41%, 100% { opacity: 0; } }
@keyframes sf-card-slide-last { 0% { opacity: 0; } 8%, 25% { opacity: 1; } 33%, 100% { opacity: 0; } }
@keyframes sf-card-slide-12 { 0% { opacity: 0; } 11%, 44% { opacity: 1; } 55%, 100% { opacity: 0; } }
@keyframes sf-card-slide-12-last { 0% { opacity: 0; } 11%, 33% { opacity: 1; } 44%, 100% { opacity: 0; } }
@keyframes sf-card-slide-8 { 0% { opacity: 0; } 16%, 50% { opacity: 1; } 66%, 100% { opacity: 0; } }
.site-shot__phone img { display: block; width: 100%; height: auto; aspect-ratio: 390 / 844; object-fit: cover; object-position: top center; border-radius: 10px; }

/* ---------- Network ---------- */
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; } }
@media (min-width: 1200px) { .team-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.member { min-width: 0; }
.member img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin-bottom: .75rem; border: var(--sf-line); border-radius: 18px; background: var(--sf-cream); }
.member__name { margin: 0; font-family: var(--sf-text); font-size: 1rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.member__name a { text-decoration: none; }
.member__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.member__role { margin: .15rem 0 0; font-size: .875rem; line-height: 1.3; }
@media (max-width: 575.98px) {
    .member__name { font-size: .85rem; }
    .member__role { font-size: .75rem; }
}

/* ---------- Invito al contatto ---------- */
.cta-card {
    padding: clamp(32px, 6vw, 72px) clamp(24px, 5vw, 64px);
    border: var(--sf-line);
    border-radius: var(--sf-radius);
    background: var(--sf-cream);
    text-align: center;
}
.cta-card .section-title { margin-bottom: .75rem; }
.cta-card > p { max-width: 36rem; margin: 0 auto; }
.contact-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2.5rem; margin: 2rem 0; padding: 0; list-style: none; }
.contact-list li { display: flex; align-items: center; gap: .75rem; text-align: left; }
.contact-list svg { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }
.contact-list small { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.contact-list a { font-weight: 500; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Fine progetto: invito a raccontare il proprio progetto */
.cta-card__face { display: block; width: 84px; height: auto; margin: 0 auto 1rem; transform: rotate(-6deg); }
.cta-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.75rem; }

/* ---------- Chat in basso a destra ---------- */
/* Senza JavaScript il bottone apre direttamente WhatsApp; con JavaScript apre le domande */
.sf-chat { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 1040; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.sf-chat__toggle { display: block; width: 62px; height: 62px; overflow: hidden; border: var(--sf-line); border-radius: 50%; background: var(--sf-pink); box-shadow: 3px 3px 0 var(--sf-ink); transition: transform .2s ease, box-shadow .2s ease; }
.sf-chat__toggle img { display: block; width: 100%; height: 100%; transform: scale(1.18) translateY(5%); }
.sf-chat__toggle:hover { transform: translate(-2px, -2px) rotate(-6deg); box-shadow: 5px 5px 0 var(--sf-ink); }
.sf-chat.is-open .sf-chat__toggle { box-shadow: none; transform: none; }
.sf-chat__panel { display: flex; flex-direction: column; width: min(340px, calc(100vw - 32px)); max-height: min(520px, calc(100svh - 110px)); overflow: hidden; border: var(--sf-line); border-radius: var(--sf-radius); background: var(--sf-cream); box-shadow: 6px 6px 0 var(--sf-ink); }
.sf-chat__panel[hidden], .sf-chat__wa[hidden] { display: none; }
.sf-chat__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: var(--sf-line); background: var(--sf-yellow); }
.sf-chat__head img { width: 40px; height: 40px; border: var(--sf-line); border-radius: 50%; background: var(--sf-pink); }
.sf-chat__head p { margin: 0; font-size: .95rem; line-height: 1.2; }
.sf-chat__head span { display: block; font-size: .72rem; font-weight: 600; opacity: .7; }
.sf-chat__close { display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; padding: 0; border: var(--sf-line); border-radius: 50%; background: var(--sf-cream); color: var(--sf-ink); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.sf-chat__log { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 14px; overflow-y: auto; }
.sf-chat__msg { align-self: flex-start; max-width: 86%; margin: 0; padding: 9px 13px; border: 1.5px solid var(--sf-ink); border-radius: 16px 16px 16px 4px; background: #fff; font-size: .92rem; line-height: 1.4; }
.sf-chat__msg--me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--sf-pink); }
.sf-chat__choices { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.sf-chat__choices:empty { display: none; }
.sf-chat__chip { padding: 6px 12px; border: var(--sf-line); border-radius: 999px; background: transparent; color: var(--sf-ink); font-family: var(--sf-text); font-size: .85rem; font-weight: 600; cursor: pointer; transition: background-color .2s ease; }
.sf-chat__chip:hover { background: var(--sf-yellow); }
.sf-chat__wa { justify-content: center; margin: 0 14px 14px; padding: 11px 20px; }
/* Fumetto accanto al bottone: la punta indica la faccia */
.sf-chat__nudge { position: relative; max-width: min(250px, calc(100vw - 100px)); margin-right: 6px; }
.sf-chat__nudge[hidden] { display: none; }
.sf-chat__nudge-text { display: block; padding: 11px 16px; border: var(--sf-line); border-radius: 18px 18px 4px 18px; background: #fff; color: var(--sf-ink); font-family: var(--sf-text); font-size: .95rem; font-weight: 600; line-height: 1.35; text-align: left; box-shadow: 3px 3px 0 var(--sf-ink); cursor: pointer; }
.sf-chat__nudge-text:hover { background: var(--sf-cream); }
.sf-chat__nudge-close { position: absolute; top: -10px; left: -10px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: var(--sf-line); border-radius: 50%; background: var(--sf-yellow); color: var(--sf-ink); font-size: .9rem; line-height: 1; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
    .sf-chat__nudge:not([hidden]) { animation: sf-nudge-in .45s cubic-bezier(.2, 1.4, .4, 1) both; transform-origin: 100% 100%; }
}
@keyframes sf-nudge-in { from { opacity: 0; transform: scale(.6) translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 575.98px) {
    .sf-chat__toggle { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) { .sf-chat__toggle, .sf-chat__toggle:hover { transition: none; transform: none; } }

/* ---------- Fascia con foto ---------- */
/* Fascia rosa con due foto verticali inclinate e l'invito al preventivo: compare solo se c'e la prima foto */
.photo-band { padding: var(--sf-section) 0; border-block: var(--sf-line); background: var(--sf-pink); overflow: hidden; }
.photo-band:not(:has(img)) { display: none; }
.photo-band__grid { display: grid; gap: clamp(40px, 6vw, 88px); align-items: center; }
@media (min-width: 768px) { .photo-band__grid { grid-template-columns: 1.1fr 1fr; } }
.photo-band__photos { position: relative; max-width: 560px; width: 100%; margin-inline: auto; padding: 0 0 22% 0; }
.photo-band__photo { display: block; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: var(--sf-line); border-radius: var(--sf-radius); background: var(--sf-cream); box-shadow: 6px 6px 0 var(--sf-ink); }
.photo-band__photo--main { position: relative; z-index: 1; width: 68%; transform: rotate(-2.5deg); }
.photo-band__photo--second { position: absolute; right: 0; bottom: 0; z-index: 2; width: 46%; transform: rotate(4deg); }
.photo-band__photos:not(:has(.photo-band__photo--second)) { padding-bottom: 0; }
.photo-band__photos:not(:has(.photo-band__photo--second)) .photo-band__photo--main { width: 82%; margin-inline: auto; }
.photo-band__text .lead-text { margin: 0 0 2rem; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .photo-band__photo { transition: transform .3s ease; }
    .photo-band__photos:hover .photo-band__photo--main { transform: rotate(-4deg) translateX(-6px); }
    .photo-band__photos:hover .photo-band__photo--second { transform: rotate(6deg) translateX(6px); }
}

/* ---------- Footer ---------- */
.site-footer { padding: 48px 0 36px; border-top: var(--sf-line); text-align: center; font-size: .92rem; overflow-wrap: anywhere; }
.site-footer .social-links { justify-content: center; margin-bottom: 1.25rem; }
.site-footer p { margin: 0 0 .35rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__sep { margin: 0 .5rem; opacity: .5; }
.site-footer__credit { font-size: .75rem; margin-top: 1rem !important; }
.site-footer .cookie-links { margin-top: .75rem; }

/* ---------- Pagine interne ---------- */
.page-intro { max-width: 900px; padding: clamp(24px, 5vw, 64px) 0 clamp(40px, 6vw, 72px); }
/* Intestazione compatta (pagina siti): titolo e introduzione affiancati, i contenuti subito sotto */
.page-intro--compact { display: grid; gap: .75rem clamp(32px, 5vw, 72px); align-items: end; max-width: none; padding: clamp(12px, 2.5vw, 32px) 0 clamp(20px, 2.5vw, 32px); }
.page-intro--compact .eyebrow { margin-bottom: .5rem; }
.page-intro--compact .page-title { margin: 0; font-size: clamp(2.2rem, 4.6vw, 3.9rem); line-height: 1.02; }
.page-intro--compact .lead-text { margin: 0; font-size: clamp(1rem, 1.3vw, 1.12rem); }
@media (min-width: 992px) { .page-intro--compact { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.empty-state { padding: 40px; border: 2px dashed var(--sf-ink); border-radius: var(--sf-radius); }
.site-grid:not(:empty) + .empty-state, .site-row:has(.site-card) + .empty-state { display: none; }

/* ---------- Pagina progetto ---------- */
/* Apertura a tutto schermo: foto di copertina con titolo, descrizione e cosa abbiamo curato */
.pj-hero { position: relative; display: flex; min-height: calc(100svh - var(--sf-header)); border-bottom: var(--sf-line); background: var(--sf-ink); color: var(--sf-cream); overflow: hidden; isolation: isolate; }
.pj-hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.pj-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(23, 23, 23, .72) 0%, rgba(23, 23, 23, .45) 40%, rgba(23, 23, 23, .08) 75%, rgba(23, 23, 23, 0) 100%), linear-gradient(180deg, rgba(23, 23, 23, .45) 0%, rgba(23, 23, 23, 0) 30%, rgba(23, 23, 23, .2) 55%, rgba(23, 23, 23, .85) 100%); }
.pj-hero__text { text-shadow: 0 1px 24px rgba(23, 23, 23, .35); }
.pj-hero__inner { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding-block: clamp(20px, 3vw, 36px) clamp(28px, 5vw, 64px); }
.pj-hero__back { align-self: flex-start; display: inline-flex; gap: .5rem; padding: 6px 14px; border: 2px solid currentColor; border-radius: 999px; font-size: .85rem; font-weight: 700; text-decoration: none; backdrop-filter: blur(6px); background: rgba(23, 23, 23, .25); transition: background-color .2s ease, color .2s ease; }
.pj-hero__back:hover { background: var(--sf-cream); color: var(--sf-ink); }
.pj-hero__text { max-width: 54rem; }
.pj-hero__text .eyebrow { margin-bottom: 1rem; }
.pj-hero__title { margin: 0 0 1.25rem; font-family: var(--sf-display); font-weight: 400; font-size: clamp(2.9rem, 7.5vw, 7rem); line-height: .98; overflow-wrap: anywhere; text-wrap: balance; }
.pj-hero__lead { max-width: 40rem; margin: 0 0 1.5rem; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.5; }
.pj-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.pj-tags:not(:has(li)) { display: none; }
.pj-tags li { padding: 5px 14px; border-radius: 999px; background: var(--sf-cream); color: var(--sf-ink); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* Capitoli (campo «sections»); senza capitoli resta il racconto libero (.project-body) */
.pj-sections { display: flex; flex-direction: column; gap: clamp(80px, 10vw, 144px); padding-top: var(--sf-section); }
.pj-sections:not(:has(.pj-section)) { display: none; }
.pj-sections:has(.pj-section) + .project-body { display: none; }
.pj-section { display: grid; gap: clamp(28px, 4vw, 56px); min-width: 0; scroll-margin-top: calc(var(--sf-header) + 24px); }
.pj-section__head, .pj-section__body { min-width: 0; }
.pj-section__body:not(:has(*)) { display: none; }
.pj-section__title { margin: 0 0 1.25rem; font-family: var(--sf-display); font-weight: 400; font-size: clamp(2.1rem, 4vw, 3.1rem); line-height: 1.02; overflow-wrap: anywhere; text-wrap: balance; }
.pj-section__credit { display: flex; align-items: center; gap: .75rem; margin: -.25rem 0 1.25rem; font-size: .95rem; font-weight: 600; }
.pj-section__credit::before { content: ""; flex: none; width: 28px; height: 2px; background: var(--sf-ink); }
.pj-section__text { max-width: 34rem; }
.pj-section__intro > :last-child { margin-bottom: 0; }
.pj-section__intro + .pj-section__text { margin-top: 1.25rem; }
@media (min-width: 992px) {
    .pj-section--split, .pj-section--grid, .pj-section--covers, .pj-section--highlight, .pj-section--wip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(40px, 5vw, 80px); align-items: start; }
    .pj-section--split .pj-section__head, .pj-section--grid .pj-section__head, .pj-section--covers .pj-section__head { position: sticky; top: calc(var(--sf-header) + 32px); }
    .pj-section--highlight, .pj-section--wip { align-items: center; }
    /* A tutta larghezza: titolo a sinistra e testo a destra, poi i contenuti sotto */
    .pj-section--wide .pj-section__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(40px, 5vw, 80px); align-items: end; }
    .pj-section--wide .pj-section__intro + .pj-section__text { margin-top: 0; }
}

/* Immagini: una per paragrafo, il corsivo diventa didascalia */
.pj-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.pj-media > p { display: flex; flex-direction: column; gap: .6rem; min-width: 0; margin: 0; }
/* Da 3 immagini in su la prima va a tutta larghezza; se poi ne resta una sola in fondo, anche lei */
.pj-media > p:only-child,
.pj-media > p:first-child:nth-last-child(n+3),
.pj-media > p:last-child:nth-child(even):nth-child(n+4) { grid-column: 1 / -1; }
.pj-media img { display: block; width: 100%; height: auto; border: var(--sf-line); border-radius: var(--sf-radius-sm); background: var(--sf-cream); }
.pj-media em { font-size: .82rem; font-style: normal; font-weight: 600; line-height: 1.35; }
/* Piu immagini nello stesso paragrafo: striscia di foto affiancate */
.pj-media > p:has(> img + img) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 1vw, 12px); }
.pj-media > p:has(> img + img) img { aspect-ratio: 3 / 4; object-fit: cover; }
.pj-media > p:has(> img + img) em { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .pj-media > p:has(> img + img) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Loghi e grafiche (SVG, 300 o 600 px): su un riquadro crema, senza ingrandirli */
.pj-media > p:has(img[src*=".svg"]), .pj-media > p:has(img[width="300"]), .pj-media > p:has(img[width="600"]) { align-items: center; justify-content: center; padding: clamp(18px, 3vw, 36px); border: var(--sf-line); border-radius: var(--sf-radius-sm); background: var(--sf-cream); text-align: center; }
.pj-media > p:has(img[src*=".svg"]) img, .pj-media > p:has(img[width="300"]) img, .pj-media > p:has(img[width="600"]) img { width: auto; max-width: 100%; max-height: 200px; border: 0; border-radius: 0; background: none; }
.pj-media > p:has(img[width="742"]) img, .pj-media > p:has(img[width="600"]) img { width: 100%; max-height: none; }

/* Griglia (layout «grid»): come split, ma le immagini restano tutte a due colonne */
.pj-section--grid .pj-media > p:nth-child(n) { grid-column: auto; }

/* In evidenza (es. il fun fact): foto inclinata con l'ombra rosa */
.pj-section--highlight .pj-section__title { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.pj-section--highlight .pj-media { grid-template-columns: 1fr; padding: 0 14px 14px 0; }
.pj-section--highlight .pj-media img { transform: rotate(-1.5deg); box-shadow: 14px 14px 0 -2px var(--sf-pink), 14px 14px 0 0 var(--sf-ink); }

/* Copertine affiancate e inclinate (es. il pezzo del mese) */
.pj-section--covers .pj-media { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 24px); padding: 14px 6px 6px; }
.pj-section--covers .pj-media > p:nth-child(n) { grid-column: auto; }
.pj-section--covers .pj-media img { aspect-ratio: 3 / 4; object-fit: cover; box-shadow: 5px 5px 0 var(--sf-ink); transition: transform .3s ease; }
.pj-section--covers .pj-media > p:nth-child(3n+1) img { transform: rotate(-3deg); }
.pj-section--covers .pj-media > p:nth-child(3n+2) img { transform: translateY(-12px) rotate(2deg); }
.pj-section--covers .pj-media > p:nth-child(3n) img { transform: rotate(-1deg); }
.pj-section--covers .pj-media em { margin-top: .4rem; text-align: center; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .pj-section--covers .pj-media > p:hover img { transform: translateY(-6px) rotate(0) scale(1.03); }
}
/* Telefono: un'immagine per riga, le copertine scorrono di lato */
@media (max-width: 575.98px) {
    .pj-media { grid-template-columns: minmax(0, 1fr); }
    .pj-section--covers .pj-media { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; gap: 18px; margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -.5); padding: 20px calc(var(--bs-gutter-x, 1.5rem) * .5) 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: calc(var(--bs-gutter-x, 1.5rem) * .5); scrollbar-width: none; }
    .pj-section--covers .pj-media::-webkit-scrollbar { display: none; }
    .pj-section--covers .pj-media > p { scroll-snap-align: start; }
}

/* Palette colori (campo «swatches»): un campione per colore con i codici */
.pj-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: clamp(10px, 1.4vw, 16px); margin: 0 0 clamp(12px, 1.6vw, 20px); padding: 0; list-style: none; }
.pj-palette:not(:has(li)) { display: none; }
.pj-swatch { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: var(--sf-line); border-radius: var(--sf-radius-sm); background: var(--sf-cream); }
.pj-swatch__chip { display: block; aspect-ratio: 4 / 3; border-bottom: var(--sf-line); }
.pj-swatch__name { padding: 10px 12px 0; font-size: .9rem; font-weight: 700; line-height: 1.25; }
.pj-swatch__hex { padding: 2px 12px 0; color: inherit; font-family: var(--sf-text); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pj-swatch__values { padding: 4px 12px 12px; font-size: .72rem; line-height: 1.4; opacity: .75; }
@media (max-width: 575.98px) {
    .pj-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pj-swatch__chip { aspect-ratio: 5 / 2; }
}

/* Lavori in corso: accanto al testo un riquadro tratteggiato per le foto in arrivo */
.pj-section--wip::after { content: ""; display: block; aspect-ratio: 16 / 10; border: 2px dashed var(--sf-ink); border-radius: var(--sf-radius); background: repeating-linear-gradient(-45deg, transparent 0 16px, rgba(23, 23, 23, .07) 16px 18px); }

/* Sito dal vivo in una finestra del browser */
.pj-browser { margin: 0; overflow: hidden; border: var(--sf-line); border-radius: var(--sf-radius); background: #fff; box-shadow: 6px 6px 0 var(--sf-ink); }
.pj-browser .browser-bar { align-items: center; }
.pj-browser__url { margin-left: 10px; overflow: hidden; font-size: .8rem; font-style: normal; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pj-browser iframe { display: block; width: 100%; height: clamp(460px, 70vh, 760px); border: 0; }
.pj-browser__link { margin: 1.5rem 0 0; }
/* Sul telefono la finestra resta piu bassa dello schermo: si continua a scorrere la pagina dai margini */
@media (max-width: 767.98px) { .pj-browser iframe { height: min(58svh, 480px); } }

/* Social incorporati */
.pj-embeds [data-consent-embeds-output] { display: grid; gap: 24px; align-items: start; }
@media (min-width: 768px) { .pj-embeds [data-consent-embeds-output] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pj-embeds [data-consent-embeds-output] > * { min-width: 0; margin: 0 !important; }
.pj-embeds iframe { width: 100% !important; min-width: 0 !important; height: 600px !important; max-height: none !important; border-radius: var(--sf-radius-sm) !important; border: var(--sf-line) !important; background: #fff; }

/* Racconto libero dei progetti non ancora divisi in capitoli */
.project-body { max-width: 820px; margin: 0 auto; padding-top: var(--sf-section); font-size: 1.05rem; line-height: 1.7; }
.project-body h1, .project-body h2, .project-body h3 { margin: 2.5rem 0 1rem; font-family: var(--sf-display); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; }
.project-body img { display: block; width: 100%; height: auto; margin: 1.5rem 0 .5rem; border-radius: var(--sf-radius-sm); }
.project-body img[width="300"], .project-body img[width="600"] { width: auto; max-width: 100%; }
.project-body em { font-size: .9rem; }
.project-body hr { margin: 3rem 0; border: 0; border-top: var(--sf-line); opacity: 1; }
.project-body iframe { max-width: 100%; }
.project-body blockquote { margin: 1.5rem 0; }

/* Pagina 404 */
.notfound { min-height: 55vh; display: flex; flex-direction: column; justify-content: center; }
.notfound img { max-width: 320px; margin-bottom: 2rem; }
