/* =========================================================
   TitaC srl — Design tokens & shared components
   Editorial Minimal / Architectural Premium
   ========================================================= */

:root {
  /* Colore */
  --bg: #FAFAF8;
  --bg-alt: #F2F3F2;
  --white: #FFFFFF;
  --ink: #252728;
  --ink-soft: rgba(37, 39, 40, 0.62);
  --ink-faint: rgba(37, 39, 40, 0.38);
  --line: rgba(37, 39, 40, 0.13);
  --line-strong: rgba(37, 39, 40, 0.22);

  /* Campionati esattamente dal logo vettoriale (barre, sx->dx) — vedi assets/MANIFEST.md */
  --azure: #00AEE6;
  --teal: #04B79E;
  --green: #59BD79;
  --lime: #82C44C;

  /* Grigio del logo: SOLO per uso decorativo/grande (es. lockup logo).
     Su sfondo chiaro fallisce WCAG per il testo (~2.75:1) — per testo usare --ink-soft/--ink-faint. */
  --logo-grey: #9A9C9F;

  /* Tipografia */
  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-text: "Archivo", "Segoe UI", Arial, sans-serif;

  /* Ritmo */
  --nav-height: 84px;
  --edge: clamp(20px, 5vw, 64px);
  --max-width: 1400px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
}

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--edge);
}

.section {
  padding: clamp(64px, 10vw, 128px) 0;
}

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

.section--flush { padding-top: 0; }

.eyebrow-note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-style: italic;
  margin-top: 0.6rem;
}

/* ---------- Tipografia ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 480;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--ink);
}

h1 { font-size: clamp(2.6rem, 6vw, 5.4rem); }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
h3 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 500; }

p {
  max-width: 62ch;
  color: var(--ink-soft);
}

p.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--ink);
  max-width: 46ch;
}

.label {
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 32ch;
}

/* ---------- Link con sottolineatura animata ---------- */

.text-link {
  position: relative;
  display: inline-block;
  font-family: var(--font-text);
  font-weight: 500;
  color: var(--ink);
  padding-bottom: 3px;
  background-image: linear-gradient(to right, var(--azure), var(--teal));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.35s ease, color 0.35s ease;
}

.text-link:hover,
.text-link:focus-visible {
  background-size: 100% 1.5px;
  color: var(--teal);
}

/* Freccia che avanza (non sui link dentro le frasi: email, privacy, cookie) */
.text-link:not([href^="mailto"]):not([href="privacy.html"]):not([href="cookie.html"])::after {
  content: "→";
  display: inline-block;
  margin-left: 0.4em;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

.text-link:hover::after,
.text-link:focus-visible::after {
  transform: translateX(0.3em);
}

/* ---------- Bottoni ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

/* Al passaggio il verde-acqua "riempie" il bottone da sinistra */
.btn--primary {
  background: linear-gradient(var(--teal), var(--teal)) no-repeat 0 0 / 0% 100%, var(--azure);
  color: var(--white);
  transition: background-size 0.45s cubic-bezier(0.65, 0, 0.35, 1), transform 0.25s ease;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-size: 100% 100%;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  border-color: var(--azure);
  color: var(--azure);
}

.btn--on-dark {
  background: var(--white);
  color: var(--ink);
}

.btn--on-dark:hover {
  background: var(--azure);
  color: var(--white);
}

/* =========================================================
   Header / Navigazione
   ========================================================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--edge);
  z-index: 600;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.site-header--light {
  background: rgba(250, 250, 248, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header--transparent {
  background: transparent;
  border-bottom: 1px solid transparent;
}

.site-header--transparent::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(20, 22, 22, 0.32), rgba(20, 22, 22, 0));
  z-index: -1;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.site-header--transparent.is-scrolled {
  background: rgba(250, 250, 248, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header--transparent.is-scrolled::before {
  opacity: 0;
}

.logo-plate {
  display: inline-flex;
  align-items: center;
  background: none;
  padding: 0;
}

.logo-plate img {
  height: 34px;
  width: auto;
  display: block;
}

/* Due versioni del logo (scritta grigia / bianca), sfondo sempre trasparente */
.logo-plate .logo--light { display: none; }

.site-header--transparent:not(.is-scrolled) .logo-plate .logo--dark,
body.menu-open .logo-plate .logo--dark { display: none; }

.site-header--transparent:not(.is-scrolled) .logo-plate .logo--light,
body.menu-open .logo-plate .logo--light { display: block; }

body.menu-open .nav-toggle { color: #fff; }

body.menu-open .site-header {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.footer-logo { margin-bottom: 1.4rem; }
.footer-logo img { height: 40px; }

/* Tendina "Servizi" */
.nav-dropdown { position: relative; }

.nav-dropdown__toggle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-text);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--nav-text, var(--ink));
  padding: 0.3rem 1rem 0.3rem 0;
  transition: color 0.25s ease;
}

.nav-dropdown__toggle::before {
  content: "";
  position: absolute;
  right: 1px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s ease;
}

.nav-dropdown:hover .nav-dropdown__toggle::before,
.nav-dropdown.is-open .nav-dropdown__toggle::before {
  transform: translateY(-30%) rotate(225deg);
}

.nav-dropdown__toggle::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(100% - 1rem);
  height: 2px;
  background: var(--azure);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-dropdown:hover .nav-dropdown__toggle::after,
.nav-dropdown__toggle.is-active::after {
  transform: scaleX(1);
}

.site-header--transparent .nav-dropdown__toggle { color: #fff; }
.site-header--transparent.is-scrolled .nav-dropdown__toggle { color: var(--ink); }

.nav-dropdown__menu {
  position: absolute;
  top: 100%;
  left: -1.2rem;
  min-width: 250px;
  padding: 1.1rem 1.2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown.is-open .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}

.site-header .main-nav .nav-dropdown__menu a { color: var(--ink); }
.site-header .main-nav .nav-dropdown__menu a:hover { color: var(--azure); }

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 3vw, 2.6rem);
}

.main-nav a {
  position: relative;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--nav-text, var(--ink));
  padding: 0.3rem 0;
  transition: color 0.25s ease;
}

.site-header--transparent .main-nav a {
  color: #fff;
}

.site-header--transparent.is-scrolled .main-nav a {
  color: var(--ink);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--azure);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-family: var(--font-text);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--nav-text, var(--ink));
  cursor: pointer;
}

.site-header--transparent .nav-toggle { color: #fff; }
.site-header--transparent.is-scrolled .nav-toggle { color: var(--ink); }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 590;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--edge);
  transform: translateY(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s linear 0.5s;
}

.mobile-menu.is-open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3rem);
  color: var(--bg);
}

.mobile-menu a:hover { color: var(--azure); }

.mobile-menu__group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.mobile-menu__label {
  font-size: 0.85rem;
  color: rgba(250, 250, 248, 0.5);
}

.mobile-menu__group a {
  font-size: clamp(1.5rem, 6vw, 2rem);
  padding-left: 1rem;
  border-left: 1px solid rgba(250, 250, 248, 0.2);
}

@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* =========================================================
   Page header (pagine interne)
   ========================================================= */

.page-header {
  padding: calc(var(--nav-height) + clamp(48px, 9vw, 96px)) 0 clamp(40px, 6vw, 64px);
}

.page-header h1 {
  max-width: 18ch;
}

/* Disegno accanto al titolo (pagina Vernici); su telefono va sotto il testo */
.page-header--side { align-items: center; }
.page-header--side > img { width: 100%; height: auto; mix-blend-mode: multiply; }

/* Fascia illustrata sotto il titolo (disegno a matita, senza testo sopra) */
.page-illustration { margin: 0 0 clamp(40px, 6vw, 72px); }
.page-illustration img {
  width: 100%; height: auto; display: block;
  mix-blend-mode: multiply; /* la carta del disegno si fonde con lo sfondo della pagina */
}
@media (max-width: 640px) {
  .page-illustration .container { padding: 0; } /* su telefono a tutta larghezza */
}

/* =========================================================
   Righe con divisori (invece di card)
   ========================================================= */

.row-list {
  display: flex;
  flex-direction: column;
}

.row-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(1.8rem, 3.4vw, 3rem) 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.row-list .row-item:last-child {
  border-bottom: 1px solid var(--line);
}

.row-item__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 480;
}

.row-item__desc {
  color: var(--ink-soft);
  max-width: 54ch;
}

/* Elenco lavori a fasce alterne bianco/grigio, da bordo a bordo (Costruzione, Ristrutturazioni) */
.row-list--bands .row-item,
.row-list--bands .row-item:last-child { border: 0; }
.row-list--bands .row-item:nth-child(even) {
  background: var(--bg-alt);
  box-shadow: 0 0 0 100vmax var(--bg-alt); /* allarga il grigio fino ai bordi dello schermo */
  clip-path: inset(0 -100vmax);
}

/* Su telefono titolo sopra e descrizione sotto: in due colonne le parole lunghe uscivano */
@media (max-width: 640px) {
  .row-item { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
}

/* =========================================================
   Split asimmetrico (testo + immagine/visual)
   ========================================================= */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.split--reverse {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.split--reverse .split__visual { order: -1; }

@media (max-width: 860px) {
  .split, .split--reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .split--reverse .split__visual { order: 0; }
}

/* ---------- Tessere placeholder (progetti, visual generico) ---------- */

.placeholder-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--bg-alt);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow: hidden;
}

.placeholder-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(3,176,220,0.10), rgba(8,182,168,0.06) 40%, transparent 70%);
}

.placeholder-tile--tall { aspect-ratio: 3 / 4; }
.placeholder-tile--wide { aspect-ratio: 16 / 9; }

.placeholder-caption {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  color: var(--ink-faint);
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(56px, 8vw, 96px) 0 clamp(24px, 4vw, 40px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(2rem, 6vw, 4rem);
  padding-bottom: clamp(40px, 6vw, 64px);
  border-bottom: 1px solid rgba(250, 250, 248, 0.14);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2.4rem; }
}

.footer-grid p {
  color: rgba(250, 250, 248, 0.62);
  max-width: 34ch;
}

.footer-heading {
  font-size: 0.9rem;
  color: rgba(250, 250, 248, 0.5);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: rgba(250, 250, 248, 0.88);
  transition: color 0.25s ease;
}

.footer-links a:hover { color: var(--azure); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-top: 1.6rem;
  font-size: 0.85rem;
  color: rgba(250, 250, 248, 0.42);
}

/* =========================================================
   Form contatti
   ========================================================= */

.form-field {
  margin-bottom: 1.8rem;
}

.form-field label {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-text);
  font-size: 1.05rem;
  color: var(--ink);
  padding: 0.5rem 0.1rem;
  transition: border-color 0.25s ease;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--azure);
}

.form-note {
  font-size: 0.88rem;
  color: var(--ink-faint);
  margin-top: 0.8rem;
}

.form-success {
  display: none;
  margin-top: 1.2rem;
  font-size: 0.98rem;
  color: var(--teal);
}

.form-success.is-visible { display: block; }

/* =========================================================
   Barra di fiducia (fatti in riga, senza puntini/eyebrow)
   ========================================================= */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.4rem, 3vw, 2.4rem);
}

.stat {
  border-top: 1px solid var(--line-strong);
  padding-top: 1.3rem;
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 460;
  font-size: clamp(2.6rem, 4.6vw, 3.8rem);
  line-height: 1;
  color: var(--ink);
}

.stat__label {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 24ch;
}

.stats-note {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-style: italic;
}

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
}

/* =========================================================
   Ritmo condiviso: stessi spazi in tutte le pagine
   ========================================================= */

:root { --gap-head: clamp(2rem, 3.5vw, 3rem); }

.eyebrow {
  color: var(--ink-faint);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.section h2 { max-width: 22ch; }
.section h3 + p, .section h3 + .label { margin-top: 0.6rem; }
p.lede { margin-top: 1.4rem; }
.after-head { margin-top: var(--gap-head); }

.section-link { margin-top: 2.2rem; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.4rem 3rem;
}

.section-head .label { margin-left: auto; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.6rem;
  margin-top: 2rem;
}

.media-43 {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Disegno 16:9 su carta (si fonde con lo sfondo della pagina) */
.media-169 {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.featured-grid,
.audience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.4rem, 3vw, 2.4rem);
}

@media (max-width: 860px) {
  .featured-grid, .audience-grid { grid-template-columns: 1fr; }
}

.featured-item { display: block; }
.featured-item img { transition: opacity 0.3s ease; }
.featured-item:hover img { opacity: 0.88; }

.audience-card {
  border-top: 1px solid var(--line-strong);
  padding-top: 1.4rem;
}

.audience-card h3 { margin-bottom: 0.6rem; }

.footer-address { color: rgba(250, 250, 248, 0.62); }

/* ---------- Icone dei tre rami (centrate sul testo) ---------- */

.branch-grid--centered .branch-card { text-align: center; }

.branch-card__icon {
  width: clamp(72px, 7vw, 92px);
  height: clamp(72px, 7vw, 92px);
  object-fit: contain;
  margin: 0 auto 1.4rem;
}

.branch-grid--centered .branch-card__desc { margin-left: auto; margin-right: auto; }

/* ---------- Sezioni con foto di sfondo ---------- */

.section--photo {
  position: relative;
  isolation: isolate;
}

.photo-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: inset(0);
  background: #14201d;
}

/* La foto resta ferma nella finestra: scorre solo il testo, e sparisce a fine sezione */
.photo-bg img {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
}

.photo-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 17, 0.66);
}

.section--photo h2,
.section--photo h3,
.section--photo .lede { color: #fff; }

.section--photo .eyebrow { color: rgba(255, 255, 255, 0.62); }

.section--photo p,
.section--photo .label { color: rgba(255, 255, 255, 0.84); }

.section--photo .audience-card { border-top-color: rgba(255, 255, 255, 0.4); }

.section--photo .text-link {
  color: #fff;
  background-image: linear-gradient(to right, #fff, #fff);
}

.section--photo .product-table th { color: rgba(255, 255, 255, 0.62); }
.section--photo .product-table td { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.3); }
.section--photo .product-table td.is-number { color: #5fd6ff; }
.section--photo .eyebrow-note { color: rgba(255, 255, 255, 0.62); }

/* =========================================================
   Tre rami / blocchi di ingresso (no card-kit: solo bordo superiore)
   ========================================================= */

.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.6rem, 3vw, 2.4rem);
}

@media (max-width: 860px) {
  .branch-grid { grid-template-columns: 1fr; }
}

.branch-card {
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-strong);
}

.branch-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  margin-bottom: 0.7rem;
}

.branch-card__desc {
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}

/* =========================================================
   Realizzazioni
   ========================================================= */

.portfolio-item__photo { display: block; cursor: zoom-in; }
.portfolio-item__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg-alt);
}

/* Altre foto dello stesso lavoro: miniature che si aprono ingrandite */
.portfolio-item__thumbs { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.portfolio-item__thumbs a { cursor: zoom-in; }
.portfolio-item__thumbs img {
  width: 64px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-alt);
  transition: opacity 0.2s ease;
}
.portfolio-item__thumbs a:hover img { opacity: 0.8; }

/* Lavoro in evidenza (#TifoPulito): foto grande con play + testo */
.case-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.case-feature__media { position: relative; display: block; }
.case-feature__media img { width: 100%; height: auto; display: block; }
.case-feature__play {
  position: absolute; left: 50%; top: 50%;
  width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.case-feature__play::after {
  content: ""; position: absolute; left: 29px; top: 23px;
  border-style: solid; border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent var(--azure);
}
.case-feature__media:hover .case-feature__play { transform: scale(1.08); }
.case-feature__text p { margin-top: 0.8rem; }
@media (max-width: 860px) {
  .case-feature { grid-template-columns: 1fr; }
}

.portfolio-item__meta {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* ---------- Slider prima / durante / dopo ---------- */

.bda-slider__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-alt);
}

.bda-slider__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.bda-slider__frame img.is-active { display: block; }

.bda-slider__tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.bda-slider__tab {
  flex: 1;
  background: none;
  border: 1px solid var(--line-strong);
  padding: 0.6rem 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.25s ease;
}

.bda-slider__tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* =========================================================
   Prodotti vernici
   ========================================================= */

.product-block {
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-top: 1px solid var(--line);
}

.product-block:last-child { border-bottom: 1px solid var(--line); }

.product-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8rem 1.6rem;
  margin-bottom: 1rem;
}

.product-block__name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.product-block__type {
  color: var(--ink-faint);
  font-size: 0.92rem;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}

.product-table th, .product-table td {
  text-align: left;
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.product-table th {
  color: var(--ink-faint);
  font-weight: 500;
  font-size: 0.82rem;
}

.product-table td.is-number {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--azure);
}

/* =========================================================
   Griglia applicazioni / supporti
   ========================================================= */

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.6rem;
}

.icon-grid__item svg {
  width: 28px;
  height: 28px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 1.5;
  margin-bottom: 0.6rem;
}

.icon-grid__item h4 {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 0.3rem;
}

.icon-grid__item p {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* =========================================================
   Timeline riconoscimenti
   ========================================================= */

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.timeline-item:last-child { border-bottom: 1px solid var(--line); }

.timeline-item__year {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink-faint);
}

.timeline-item__text {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Riconoscimenti su due colonne (Italia / Europa) */
.recognitions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}

@media (max-width: 860px) {
  .recognitions { grid-template-columns: 1fr; }
}

.recognitions__title { margin-bottom: 1rem; }

.patent-title { font-style: italic; max-width: 60ch; }

/* Pagine del depliant */
.depliant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.8rem);
}

@media (max-width: 700px) {
  .depliant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.depliant-grid a { display: block; border: 1px solid var(--line); }
.depliant-grid img { width: 100%; height: auto; transition: opacity 0.3s ease; }
.depliant-grid a:hover img { opacity: 0.85; }

.lightbox {
  border: 0; padding: 0; background: transparent;
  max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  display: none; align-items: center; justify-content: center;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(37, 39, 40, 0.88); }
.lightbox img { max-width: min(92vw, 1400px); max-height: 88vh; width: auto; height: auto; }
.lightbox__close {
  position: fixed; top: 16px; right: 16px; width: 48px; height: 48px;
  border: 0; border-radius: 50%; background: var(--white); color: var(--ink);
  font-size: 30px; line-height: 1; cursor: pointer;
}
.lightbox__close:hover { opacity: 0.85; }

/* =========================================================
   Come funziona — diagramma
   ========================================================= */

.how-it-works {
  margin-top: 1rem;
}

.how-it-works svg {
  width: 100%;
  height: auto;
}

.how-steps { display: none; }
@media (max-width: 640px) {
  .how-it-works { display: none; }
  .how-steps { display: grid; gap: 1.1rem; list-style: none; padding: 0; margin-top: 1.5rem; }
  .how-steps li { position: relative; padding-left: 2rem; font-size: 0.95rem; color: var(--ink-soft); }
  .how-steps li::before { content: ""; position: absolute; left: 0; top: 0.2rem; width: 0.95rem; height: 0.95rem; border-radius: 50%; border: 2px solid var(--c); }
  .how-steps li:not(:last-child)::after { content: ""; position: absolute; left: calc(0.475rem - 0.5px); top: 1.45rem; bottom: -0.95rem; width: 1px; background: var(--line-strong); }
  .how-steps b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; color: var(--ink); }
}

/* =========================================================
   Form: select e radio (oltre a input/textarea)
   ========================================================= */

.form-field select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-text);
  font-size: 1.05rem;
  color: var(--ink);
  padding: 0.5rem 0.1rem;
  transition: border-color 0.25s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23252728' stroke-width='1.4' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
}

.form-field select:focus { border-color: var(--azure); }

.form-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.form-field .form-radio {
  display: flex;
  margin-bottom: 0;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
}

.form-field .form-radio input { width: auto; padding: 0; accent-color: var(--azure); }

.form-field--conditional {
  display: none;
}

.form-field--conditional.is-visible {
  display: block;
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =========================================================
   Testo legale (privacy/cookie)
   ========================================================= */

.legal-content h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin-top: 2.4rem;
  margin-bottom: 0.8rem;
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content p, .legal-content li {
  color: var(--ink-soft);
  max-width: 68ch;
  margin-bottom: 0.9rem;
}

.legal-content li { margin-left: 1.4rem; }

/* ---------- Elenco contatti ---------- */

/* Contatti: titolo, frase e recapiti a sinistra, form a destra fin dall'alto */
.contact-top .contact-list { margin-top: clamp(2rem, 4vw, 3rem); }

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.contact-list dt {
  font-size: 0.88rem;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}

.contact-list dd {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.contact-list dd a:hover { color: var(--azure); }

.map-link {
  margin-top: 0.5rem;
}

/* Variante chiara: sfondi in stile sketch, velo color carta e testo scuro */
.section--photo-light .photo-bg { background: #F8F8F8; }
/* Sezione con poco testo: altezza minima per far vedere il disegno dietro */
.section--tall { min-height: 80vh; display: flex; align-items: center; }
.section--tall > .container { width: 100%; }
.section--photo-light .photo-bg::after { background: rgba(248, 248, 248, 0.72); }
.section--photo-light.section--veil-strong .photo-bg::after { background: rgba(248, 248, 248, 0.84); }
/* Variante statica: l'immagine scorre con la pagina invece di restare ferma */
.section--photo-static .photo-bg img { position: absolute; height: 100%; }
/* su telefono inquadratura centrata sul disegno */
.section--veil-light .photo-bg img { object-position: 72% center; }
/* su telefono il velo pieno nascondeva il disegno: più leggero, inquadrato sulla parte bassa (il capannone) */
@media (max-width: 640px) {
  .section--photo-light.section--veil-light .photo-bg::after { background: linear-gradient(180deg, rgba(248, 248, 248, 0.92) 0%, rgba(248, 248, 248, 0.75) 45%, rgba(248, 248, 248, 0.15) 100%); }
  .section--veil-light .photo-bg img { object-position: 78% 75%; }
  .section--veil-light.section--tall { align-items: flex-start; }
}
/* Velo leggero: il testo sta sul lato vuoto del disegno (su telefono resta il velo normale, il testo ci passa sopra) */
@media (min-width: 641px) {
  .section--photo-light.section--veil-light .photo-bg::after { background: rgba(248, 248, 248, 0.25); }
  .section--veil-light .photo-bg img { object-position: left center; } /* disegno il piu' a destra possibile */
  .section--veil-light .lede { max-width: 34ch; }
}

.section--photo-light h2,
.section--photo-light h3,
.section--photo-light .lede { color: var(--ink); }

.section--photo-light .eyebrow { color: rgba(37, 39, 40, 0.6); }

.section--photo-light p,
.section--photo-light .label { color: rgba(37, 39, 40, 0.82); }

.section--photo-light .audience-card { border-top-color: var(--line-strong); }

.section--photo-light .text-link {
  color: var(--ink);
  background-image: linear-gradient(to right, var(--azure), var(--teal));
}

.section--photo-light .product-table th { color: rgba(37, 39, 40, 0.6); }
.section--photo-light .product-table td { color: var(--ink); border-bottom-color: var(--line-strong); }
.section--photo-light .product-table td.is-number { color: #00759e; } /* azzurro del logo scurito: contrasto ~4,9:1 */
.section--photo-light .eyebrow-note { color: rgba(37, 39, 40, 0.66); }

/* =========================================================
   Animazioni di comparsa (classi aggiunte da main.js;
   senza JavaScript o con "riduci movimento" non si attivano)
   ========================================================= */

/* Blocchi che salgono e si accendono entrando nello schermo */
/* "translate" (non "transform") così non cancella le rotazioni proprie degli elementi, es. le foto dell'album */
.reveal {
  opacity: 0;
  translate: 0 16px;
  transition: opacity 0.55s ease, translate 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), transform .35s ease, box-shadow .35s ease;
  transition-delay: var(--reveal-delay, 0s), var(--reveal-delay, 0s), 0s, 0s; /* il ritardo vale solo per la comparsa, non per l'hover */
}

.reveal.is-visible {
  opacity: 1;
  translate: none;
}

/* Titoli: ogni parola esce da dietro una maschera */
.reveal-title .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.12em;   /* non tagliare le lettere con la "coda" (g, p, q) */
  margin-bottom: -0.12em;
}

.reveal-title .w > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal-title.is-visible .w > span { transform: none; }

/* Passaggio morbido tra le pagine (browser recenti; gli altri cambiano pagina come prima) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  ::view-transition-old(root) { animation: page-out 0.2s ease both; }
  ::view-transition-new(root) { animation: page-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}

@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

/* Riquadro finale "contattaci": disegno a tutto schermo, velo color carta sotto il testo (sinistra), disegno pulito a destra */
.section--veil-side .photo-bg img { object-position: 72% center; } /* su telefono resta inquadrato il soggetto */
.section--veil-side .photo-bg::after { background: rgba(248, 248, 248, 0.72); }
@media (min-width: 641px) {
  .section--veil-side .photo-bg::after {
    background: linear-gradient(90deg, rgba(248, 248, 248, 0.92) 0%, rgba(248, 248, 248, 0.7) 40%, rgba(248, 248, 248, 0) 75%);
  }
}

/* ---------- Realizzazioni: album di foto "stampate" ---------- */
.album { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(2rem,4vw,3.5rem) clamp(1.5rem,3vw,2.75rem); align-items: start; }
.print { margin: 0; background: #fff; padding: 12px 12px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 28px rgba(37,39,40,.12); transform: rotate(-1.4deg); transition: transform .35s ease, box-shadow .35s ease; }
.print:nth-child(3n+2) { transform: rotate(1.1deg); margin-top: 1.5rem; }
.print:nth-child(3n) { transform: rotate(-0.6deg); }
.print:nth-child(4n) { transform: rotate(1.6deg); }
.print:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 18px 40px rgba(37,39,40,.18); }
.print figcaption { padding: 14px 4px 0; }
.print__title { display: block; font-family: var(--font-display); font-style: italic; font-size: 1.12rem; line-height: 1.3; color: var(--ink); }
.print__meta { display: block; margin-top: .25rem; font-size: .82rem; color: var(--ink-faint); }
.print .portfolio-item__thumbs img { width: 52px; }
.album-wall { background: var(--bg-alt); }
@media (max-width: 860px) { .album { grid-template-columns: repeat(2, minmax(0,1fr)); } .print:nth-child(n) { margin-top: 0; } }
@media (max-width: 560px) { .album { grid-template-columns: 1fr; } }
.works-feature { margin-top: clamp(3.5rem, 7vw, 5.5rem); }
/* Altri lavori: piccolo elenco in fondo, su una riga separata da punti */
.works-more { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: 1.5rem; border-top: 1px solid var(--line); }
.works-more ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 0; margin-top: 0.6rem; font-size: 0.88rem; color: var(--ink-soft); }
.works-more li:not(:last-child)::after { content: "·"; margin: 0 0.7rem; color: var(--ink-faint); }
@media (max-width: 640px) {
  .works-more ul { flex-direction: column; gap: 0.45rem; }
  .works-more li:not(:last-child)::after { content: none; }
}

/* ---------- Sfondi: su telefono immagine verticale dedicata, centrata (niente piu' tagli laterali) ---------- */
@media (max-width: 640px) {
  .photo-bg--vertical img { object-position: center !important; }
}

/* ---------- Shop online in arrivo: voce "Shop" nel menu, fascia in Vernici, etichette sui prodotti ---------- */
.soon-tag { display: inline-block; margin-left: .35rem; padding: .1rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: linear-gradient(90deg, #00AEE6, #59BD79); vertical-align: middle; }
.soon-tag--line { margin-left: 0; color: #00759e; background: none; border: 1px solid currentColor; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .75rem; }
.main-nav a.nav-soon::after { display: none; }
.shop-banner { display: flex; align-items: center; gap: 1.2rem 1.6rem; flex-wrap: wrap; margin: 0 0 clamp(2.5rem, 5vw, 3.5rem); padding: 1.1rem 1.4rem; border: 1px solid var(--line); background: linear-gradient(90deg, rgba(0,174,230,.08), rgba(130,196,76,.08)); scroll-margin-top: calc(var(--nav-height) + 1rem); }
.shop-banner p { flex: 1 1 320px; font-size: .95rem; color: var(--ink-soft); }
.shop-banner strong { color: var(--ink); font-weight: 600; }
.shop-banner__bars { display: flex; gap: 3px; height: 26px; }
.shop-banner__bars i { width: 5px; height: 100%; background: #00AEE6; }
.shop-banner__bars i:nth-child(2) { background: #04B79E; }
.shop-banner__bars i:nth-child(3) { background: #2FBA8B; }
.shop-banner__bars i:nth-child(4) { background: #59BD79; }
.shop-banner__bars i:nth-child(5) { background: #82C44C; }
.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

/* Tabelle dei prodotti (Vernici): su telefono la colonna "Fonte test" diventa una riga sotto le percentuali */
.product-table--source caption { display: none; }
@media (max-width: 640px) {
  .product-table--source th:nth-child(3),
  .product-table--source td:nth-child(3) { display: none; }
  .product-table--source caption { display: table-caption; caption-side: bottom; text-align: left; padding-top: 0.6rem; font-size: 0.8rem; font-style: italic; color: var(--ink-faint); }
}
