:root {
  --font-sans: "Fira Sans", ui-sans-serif, system-ui, sans-serif;
  --background: oklch(1 0 0);
  --foreground: oklch(0.18 0 0);
  --muted: oklch(0.955 0 0);
  --muted-foreground: oklch(0.52 0 0);
  --border: oklch(0.9 0 0);
  --online: oklch(0.63 0.19 145);
  --gutter: 24px;
}
@media (min-width: 768px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--border); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
main { padding-bottom: 4rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.ff-wrap { max-width: 1800px; margin-inline: auto; padding-inline: var(--gutter); }

/* Tipografia editoriale */
.editorial-label { font-size: 0.75rem; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-transform: uppercase; }
.editorial-title { font-size: 1rem; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-transform: uppercase; color: var(--foreground); }
.editorial-body { font-size: 13px; font-weight: 400; line-height: 1.6; letter-spacing: 0; color: var(--muted-foreground); }
.muted { color: var(--muted-foreground); }
.fg { color: var(--foreground); }
.site-brand { font-size: 18px; font-weight: 600; letter-spacing: 0.03em; }

.ff-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  color: var(--muted-foreground); transition: color 150ms;
}
.ff-btn:hover { color: var(--foreground); }
.ff-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Voci di navigazione: parentesi leggere sulla voce attiva, senza spostamenti */
.nav-link { position: relative; color: var(--muted-foreground); transition: color 150ms; }
.nav-link:hover, .nav-link[data-active="true"] { color: var(--foreground); }
.nav-link::before, .nav-link::after {
  position: absolute; top: 50%; opacity: 0; transform: translateY(-50%);
  font-weight: 400; transition: opacity 150ms ease-out; pointer-events: none;
}
.nav-link::before { content: "["; right: calc(100% + 3px); }
.nav-link::after { content: "]"; left: calc(100% + 3px); }
.nav-link[data-active="true"]::before, .nav-link[data-active="true"]::after { opacity: 1; }

/* Intestazione */
.site-header { position: sticky; top: 0; z-index: 50; background: oklch(1 0 0 / 0.9); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.site-header__top { position: relative; max-width: 1800px; margin-inline: auto; padding: 24px var(--gutter) 14px; transition: padding 200ms; }
.site-header.has-filter .site-header__top { padding-bottom: 0; }
@media (min-width: 768px) {
  .site-header__top { padding-top: 32px; padding-bottom: 16px; }
  .site-header.is-compact .site-header__top { padding-top: 20px; }
}
.site-header__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; }
@media (min-width: 640px) { .site-header__row { display: flex; justify-content: space-between; } }
@media (min-width: 768px) { .site-header__row { gap: 32px; } }
.site-header__row.has-logo { align-items: center; }
.site-header__logo { display: flex; min-width: 0; align-items: center; gap: 12px; }
.site-header__logo img { height: 50px; width: auto; flex-shrink: 0; }
@media (min-width: 768px) { .site-header__logo img { height: 62px; } }
.site-header__tagline { margin-top: 6px; }
@media (min-width: 768px) { .site-header__tagline { margin-top: 8px; } }
.site-header__filter { max-width: 1800px; margin-inline: auto; padding: 16px var(--gutter); }
.site-header__spacer { height: 24px; }
@media (min-width: 768px) { .site-header__spacer { height: 32px; } }

.menu { position: relative; flex-shrink: 0; }
.menu__desktop { display: none; }
.menu__burger { position: relative; display: block; width: 24px; height: 12px; }
.menu__burger span { position: absolute; left: 0; width: 100%; height: 1px; background: var(--foreground); transition: transform 200ms, opacity 200ms; }
.menu__burger span:nth-child(1) { top: 0; }
.menu__burger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu__burger span:nth-child(3) { bottom: 0; }
.menu.is-open .menu__burger span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu.is-open .menu__burger span:nth-child(2) { opacity: 0; }
.menu.is-open .menu__burger span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
/* Dopo le regole dell'hamburger: su computer resta solo la voce Menu. */
@media (min-width: 640px) { .menu__desktop { display: inline; } .menu__burger { display: none; } }
.menu__panel {
  position: absolute; right: 0; top: 100%; z-index: 50; margin-top: 12px;
  display: none; width: fit-content; min-width: 176px; flex-direction: column; align-items: flex-start; gap: 12px;
  white-space: nowrap; border-width: 1px; background: oklch(1 0 0 / 0.9); padding: 16px 20px;
  -webkit-backdrop-filter: blur(40px) saturate(1.5); backdrop-filter: blur(40px) saturate(1.5);
  animation: menu-enter 200ms ease-out;
}
.menu.is-open .menu__panel { display: flex; }
.menu__sep { height: 1px; width: 100%; background: var(--border); }
@keyframes menu-enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.social { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.social a { color: var(--muted-foreground); transition: color 150ms; }
.social a:hover { color: var(--foreground); }

/* Barra categorie */
.category-bar {
  display: flex; width: 100%; max-width: 100%; flex-wrap: nowrap; align-items: center; justify-content: space-between;
  column-gap: 8px; row-gap: 0.5rem;
}
.category-bar a { white-space: nowrap; padding: 2px 0; font-size: 11px; letter-spacing: 0.06em; }
.category-bar .only-wide { display: none; }
@media (min-width: 640px) {
  .category-bar { margin-inline: auto; width: fit-content; flex-wrap: wrap; justify-content: center; column-gap: clamp(56px, calc((100vw - 480px) / 2), 120px); }
  .category-bar a { font-size: 14px; letter-spacing: 0; }
  .category-bar .only-wide { display: inline; }
  .category-bar .only-narrow { display: none; }
}
@media (max-width: 359px) {
  .category-bar { column-gap: 10px; }
  .category-bar a { font-size: 9px; }
}

.category-intro { display: none; margin: 0 auto 24px; text-align: center; text-wrap: balance; }
@media (min-width: 640px) { .category-intro { display: block; } }
@media (min-width: 900px) { .category-intro { white-space: nowrap; } }
@media (min-width: 900px) and (max-width: 1100px) { .category-intro { white-space: normal; } }

/* Griglia a colonne: le colonne le compone site.js, senza JS resta una colonna */
.masonry { display: flex; flex-direction: column; column-gap: 24px; }
.masonry.gap-8 { column-gap: 32px; }
@media (min-width: 640px) { .masonry.is-ready { flex-direction: row; align-items: flex-start; } }
.masonry__col { min-width: 0; flex: 1 1 0%; }

.portfolio-work { display: block; width: 100%; margin-bottom: 24px; }
.portfolio-work__media { position: relative; overflow: hidden; background: var(--background); }
@media (min-width: 640px) { .portfolio-work__media { background: var(--muted); } }
.portfolio-work img, .album-photo { display: block; width: 100%; }
.album-photo { margin-bottom: 24px; }
.portfolio-work-overlay { display: none; pointer-events: none; }
.portfolio-work-overlay > div { width: 100%; max-width: 24rem; }
.portfolio-work-caption { margin-bottom: 16px; }
.portfolio-work-caption .editorial-label { margin-top: 12px; color: var(--foreground); }
.portfolio-work-caption .editorial-body { margin-top: 4px; }
@media (hover: hover) and (pointer: fine) {
  .portfolio-work-caption { display: none; }
  .portfolio-work-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: oklch(1 0 0 / 0.8); padding: 16px; opacity: 0; transition: opacity 180ms ease-out;
  }
  .portfolio-work:hover .portfolio-work-overlay, .portfolio-work:focus-visible .portfolio-work-overlay { opacity: 1; }
}

.credits { margin-top: 8px; }
.credits > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.credits > div + div { margin-top: 4px; }
.credits dt { color: var(--muted-foreground); }
.credits dd { min-width: 0; overflow-wrap: anywhere; }

/* Su telefono la foto occupa l'intera colonna, con le sue proporzioni naturali. */
@media (max-width: 639px) {
  img.viewport-photo { display: block; width: 100%; height: auto; max-width: 100%; margin-inline: auto; }
}

/* Intestazione su telefono: la frase sotto il nome resta solo in cima alla pagina;
   titolo, menu e categorie restano sempre a vista. */
.site-header { overflow-anchor: none; }
.site-header-hold { display: none; }
.balance { text-wrap: balance; }
@media (max-width: 639px) {
  /* Intestazione fissa: la chiusura della frase non sposta la pagina, quindi niente scatti. */
  .site-header { position: fixed; left: 0; right: 0; top: 0; }
  .site-header-hold { display: block; height: var(--site-header-full, 0px); }
  .site-header-vp {
    display: grid; grid-template-rows: 1fr; opacity: 1; visibility: visible;
    transition: grid-template-rows 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 340ms cubic-bezier(0.33, 1, 0.68, 1), visibility 0s;
  }
  .site-header-vp > div { min-height: 0; overflow: hidden; }
  .site-header[data-at-top="false"] .site-header-vp {
    grid-template-rows: 0fr; opacity: 0; visibility: hidden;
    transition: grid-template-rows 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 340ms cubic-bezier(0.33, 1, 0.68, 1), visibility 0s linear 480ms;
  }
}

.back-top { margin-top: 24px; display: flex; justify-content: center; }

.gallery-item { animation: gallery-reveal 550ms cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: var(--reveal-delay, 0ms); }
@keyframes gallery-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.scroll-reveal.reveal-armed { opacity: 0; transition: opacity 250ms ease-out; }
.scroll-reveal.reveal-armed.is-visible { opacity: 1; }

/* Album */
.album-head { display: grid; gap: 24px; margin-bottom: 40px; border-top: 1px solid oklch(0.9 0 0 / 0.6); padding-top: 32px; }
@media (min-width: 768px) { .album-head { grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 48px; padding-top: 40px; } }
.album-head h1 { color: var(--foreground); text-transform: uppercase; font-size: 15px; }
.album-head p { max-width: 36rem; }

.related { margin-top: 80px; border-top: 1px solid oklch(0.9 0 0 / 0.6); padding-top: 40px; }
.related h2 { margin-bottom: 24px; }
.related__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .related__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .related__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.related__item { display: block; width: 100%; min-width: 0; max-width: 220px; }
.related__item img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--muted); transition: opacity 500ms; }
.related__item:hover img { opacity: 0.85; }
.related__item p { margin-top: 8px; color: var(--foreground); }

.back-home { margin-top: 80px; display: flex; justify-content: center; }
@media (min-width: 768px) { .back-home { margin-top: 96px; } }

/* Premi & Pubblicazioni */
.awards { margin-top: 48px; padding-bottom: 40px; }
.award { display: block; width: 100%; margin-bottom: 56px; }
.award img { margin-inline: auto; width: 100%; max-width: 100%; object-fit: contain; }
.award__body { margin-top: 16px; }
.award h2 { margin-top: 4px; }
.award .editorial-body { margin-top: 8px; white-space: pre-line; }
.award__links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 20px; }

/* Contatti */
.contact-grid { display: grid; gap: 48px; }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 7fr 5fr; } }
.contact-grid h1 { max-width: 42rem; }
.contact-bio { margin-top: 16px; max-width: 36rem; }
.contact-bio p + p { margin-top: 24px; }
.contact-list { margin-top: 48px; border-top-width: 1px; padding-top: 32px; }
.contact-list > div + div { margin-top: 32px; }
.contact-list dd { margin-top: 8px; }
.contact-list a { overflow-wrap: anywhere; transition: color 150ms; }
.contact-list a:hover { color: var(--foreground); }
.contact-photo { width: 100%; max-height: 85svh; object-fit: contain; object-position: top; }

.page-content { max-width: 48rem; }
.page-content h2, .page-content h3 { margin: 2em 0 0.5em; font-size: 0.875rem; font-weight: 400; text-transform: uppercase; color: var(--foreground); }
.page-content p, .page-content ul { margin: 0 0 1em; color: var(--muted-foreground); }
.page-content a { text-decoration: underline; }

/* Recensioni e clienti */
.clients { padding-top: 32px; }
.reviews { border-top-width: 1px; padding-top: 24px; }
.reviews__score { margin-top: 32px; display: flex; align-items: center; gap: 20px; color: var(--foreground); }
.stars { display: flex; gap: 4px; }
.reviews__scroller { margin-top: 40px; display: flex; gap: 32px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 8px; scrollbar-width: none; }
.reviews__scroller::-webkit-scrollbar { display: none; }
.review { width: 85%; flex-shrink: 0; scroll-snap-align: start; }
@media (min-width: 640px) { .review { width: 45%; } }
@media (min-width: 1280px) { .review { width: 30%; } }
.review blockquote { margin-top: 16px; }
.review figcaption { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted-foreground); }
.review figcaption .editorial-body { text-transform: none; }
.review__avatar { width: 28px; height: 28px; border-radius: 9999px; object-fit: cover; filter: grayscale(1); }
.review--more { display: flex; align-items: center; color: var(--muted-foreground); transition: color 150ms; }
.review--more:hover { color: var(--foreground); }
.reviews__nav { margin-top: 24px; display: flex; justify-content: flex-end; gap: 4px; }
.reviews__nav button { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--muted-foreground); transition: color 200ms, transform 200ms; }
.reviews__nav button:hover { color: var(--foreground); }
.reviews__nav button:first-child:hover { transform: translateX(-2px); }
.reviews__nav button:last-child:hover { transform: translateX(2px); }

.testimonials { margin-top: 40px; border-top-width: 1px; padding-top: 32px; }
.testimonials__grid { margin-top: 24px; display: grid; gap: 32px; }
@media (min-width: 640px) { .testimonials__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.testimonials blockquote { white-space: pre-line; }
.testimonials figcaption { margin-top: 16px; }

.partners { margin-top: 24px; border-top-width: 1px; padding-top: 32px; }
.partners__rows { margin-top: 32px; opacity: 0.5; transition: opacity 500ms; }
.partners__rows:hover { opacity: 0.9; }
.partners__rows > * + * { margin-top: 8px; }
.marquee-mask {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-track, .marquee-copy { display: flex; }
.marquee-track { width: max-content; }
.marquee-item { flex-shrink: 0; }
.marquee-mask.is-moving .marquee-item {
  animation: marquee linear infinite; animation-duration: var(--marquee-duration, 70s);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.marquee-mask.is-reverse .marquee-item { animation-direction: reverse; }
@keyframes marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(-1 * var(--marquee-shift, 0px)), 0, 0); } }
.client-logo { display: flex; height: 64px; flex-shrink: 0; align-items: center; justify-content: center; padding-inline: 32px; text-align: center; }
@media (min-width: 768px) { .client-logo { padding-inline: 40px; } }
.client-logo img { height: 40px; width: auto; max-width: 144px; object-fit: contain; filter: grayscale(1); }
.client-logo img.is-light { filter: grayscale(1) brightness(0); }

/* Piè di pagina */
.site-footer { padding-top: 48px; padding-bottom: 128px; }
.site-footer__grid { display: grid; grid-template-columns: 1fr; align-items: center; gap: 24px; border-top-width: 1px; padding-top: 24px; text-align: center; }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: repeat(3, 1fr); text-align: left; } }
.site-footer__legal { display: flex; flex-direction: column; gap: 4px; color: var(--muted-foreground); }
.site-footer__nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 24px; row-gap: 8px; }
.site-footer__social { display: flex; align-items: center; justify-content: center; gap: 24px; }
.site-footer__social .nav-link { opacity: 0.7; }
@media (min-width: 768px) { .site-footer__social { justify-content: flex-end; } }

/* Contattami */
.contact-fab { position: fixed; bottom: 16px; right: 24px; z-index: 50; }
@media (min-width: 768px) { .contact-fab { right: 40px; } }
.contact-fab__toggle {
  display: inline-flex; height: 44px; align-items: center; gap: 12px; padding: 0 16px;
  border: 1px solid oklch(0.18 0 0 / 0.25); background: var(--background); color: var(--foreground);
}
.contact-fab__toggle:hover { border-color: var(--foreground); }
.contact-fab__toggle svg { width: 16px; height: 16px; transition: transform 200ms; }
.contact-fab.is-open .contact-fab__toggle svg { transform: rotate(45deg); }
.pulse-dot { position: relative; width: 6px; height: 6px; flex-shrink: 0; border-radius: 9999px; background: var(--online); }
.pulse-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 9999px; background: var(--online); opacity: 0;
  animation: dot-breathe 2.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes dot-breathe { 0% { opacity: 0.45; transform: scale(1); } 60%, 100% { opacity: 0; transform: scale(2.8); } }
.contact-panel {
  position: absolute; right: 0; bottom: calc(100% + 8px); display: none; width: 288px; max-width: calc(100vw - 3rem);
  border-width: 1px; background: var(--background); color: var(--foreground);
}
.contact-fab.is-open .contact-panel { display: block; animation: contact-enter 180ms ease-out; }
@keyframes contact-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.contact-panel__item { display: flex; min-width: 0; flex: 1; align-items: center; gap: 12px; padding: 16px; }
.contact-panel__item svg { width: 18px; height: 18px; flex-shrink: 0; }
.contact-panel__item > span { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.contact-panel__row { display: flex; align-items: center; border-top-width: 1px; }
.contact-panel__copy { margin-right: 8px; display: inline-flex; width: 44px; height: 44px; flex-shrink: 0; align-items: center; justify-content: center; color: var(--muted-foreground); }
.contact-panel__copy:hover { color: var(--foreground); }
.contact-panel__copy svg { width: 16px; height: 16px; }
.contact-panel__status { display: block; padding: 0 16px 12px; }
.contact-panel__status:empty { display: none; }
.break-all { word-break: break-all; }

/* 404 */
.not-found { display: flex; min-height: 60vh; align-items: center; justify-content: center; text-align: center; }
.not-found h2 { margin-top: 16px; }
.not-found p { margin-top: 8px; }
.not-found .ff-btn { margin-top: 24px; }

/* Banner e icona iubenda */
html body #iubenda-cs-banner.iubenda-cs-bottom, html body #iubenda-cs-banner.iubenda-cs-center { align-items: flex-end !important; }
html body #iubenda-cs-banner .iubenda-cs-container { margin-top: auto !important; }
html body .iubenda-tp-btn.iubenda-cs-preferences-link[data-tp-float][data-tp-icon] {
  bottom: 16px !important; left: 24px !important; right: auto !important; margin: 0 !important;
  transform: scale(0.75) !important; transform-origin: bottom left !important; opacity: 0.55 !important; transition: opacity 180ms ease !important;
}
html body .iubenda-tp-btn.iubenda-cs-preferences-link[data-tp-float][data-tp-icon]:hover { opacity: 1 !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .scroll-reveal.reveal-armed { opacity: 1; }
}

/* LLM info */
.llm { max-width: 48rem; }
.llm > p { margin-top: 16px; }
.llm section { margin-top: 48px; }
.llm section > div { margin-top: 16px; }
.llm section > div > * + * { margin-top: 16px; }
.llm dl { border-top-width: 1px; border-bottom-width: 1px; }
.llm dl > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; }
.llm dl > div + div { border-top-width: 1px; }
.llm dt { width: 16rem; flex-shrink: 0; color: var(--muted-foreground); }
@media (min-width: 640px) { .llm dl > div { flex-direction: row; gap: 24px; } }
.llm ul { margin: 0; padding-left: 20px; list-style: disc; }
.llm ul li + li { margin-top: 8px; }
.llm__updated { margin-top: 48px; border-top-width: 1px; padding-top: 24px; color: var(--muted-foreground); }

/* Privacy Policy */
.privacy h1, .privacy > p, .privacy__sections { max-width: 42rem; }
.privacy > p { margin-top: 24px; }
.privacy__sections { margin-top: 48px; border-top-width: 1px; padding-top: 40px; }
.privacy__sections section + section { margin-top: 40px; }
.privacy__sections .editorial-body { margin-top: 16px; }
.privacy__sections .editorial-body p + p { margin-top: 16px; }
