/* ============================================================
   Sito vetrina - Leonardo Paiola
   Palette: bianco caldo (crema) + arancio terracotta
   Matchata al biglietto da visita.
   ============================================================ */

/* ---------- 1. VARIABILI (palette + tipografia) ---------- */
:root {
  /* Sfondi */
  --bg-cream:    #FAF6EF;
  --bg-soft:     #F2EADB;
  --bg-card:     #FFFFFF;
  --bg-accent:   #C8553D;

  /* Testi */
  --text-dark:   #2A211B;
  --text-soft:   #5A4F47;
  --text-mute:   #8A7E72;
  --text-light:  #FAF6EF;

  /* Accenti */
  --accent:        #C8553D;  /* terracotta */
  --accent-dark:   #A33F2C;
  --accent-soft:   #E8B098;  /* terracotta chiaro */

  /* Linee e ombre */
  --border:      #E5DCC9;
  --border-soft: #EFE7D6;
  --shadow-sm:   0 1px 2px rgba(42, 33, 27, 0.05);
  --shadow-md:   0 6px 18px rgba(42, 33, 27, 0.08);
  --shadow-lg:   0 14px 36px rgba(42, 33, 27, 0.12);

  /* Tipografia */
  --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --container-max: 1100px;
  --container-narrow: 720px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Nav glass effect (light) */
  --nav-bg: rgba(250, 246, 239, 0.92);
  --hero-glow: rgba(232, 176, 152, 0.6);
}

/* ============================================================
   DARK THEME PALETTE
   Si attiva in due casi:
   1) utente ha scelto esplicitamente con data-theme="dark"
   2) sistema in dark mode E l'utente non ha scelto "light"
   ============================================================ */

:root[data-theme="dark"] {
  /* Sfondi caldi e profondi (anziché grigi neutri) */
  --bg-cream:    #1A1612;
  --bg-soft:     #221C16;
  --bg-card:     #2A211B;
  --bg-accent:   #A33F2C;

  /* Testi crema su sfondo scuro */
  --text-dark:   #F2EADB;
  --text-soft:   #C5B7A6;
  --text-mute:   #877A6C;
  --text-light:  #F2EADB;

  /* Accenti leggermente più chiari per leggibilità sul dark */
  --accent:        #DA6B53;
  --accent-dark:   #C8553D;
  --accent-soft:   #E8B098;

  /* Bordi e ombre */
  --border:       #3A2F27;
  --border-soft:  #2D241D;
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md:    0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg:    0 14px 36px rgba(0, 0, 0, 0.55);

  --nav-bg:       rgba(26, 22, 18, 0.85);
  --hero-glow:    rgba(200, 85, 61, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-cream:    #1A1612;
    --bg-soft:     #221C16;
    --bg-card:     #2A211B;
    --bg-accent:   #A33F2C;
    --text-dark:   #F2EADB;
    --text-soft:   #C5B7A6;
    --text-mute:   #877A6C;
    --text-light:  #F2EADB;
    --accent:      #DA6B53;
    --accent-dark: #C8553D;
    --accent-soft: #E8B098;
    --border:      #3A2F27;
    --border-soft: #2D241D;
    --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md:   0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg:   0 14px 36px rgba(0, 0, 0, 0.55);
    --nav-bg:      rgba(26, 22, 18, 0.85);
    --hero-glow:   rgba(200, 85, 61, 0.25);
  }
}

/* ---------- 2. RESET BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-dark);
  background: var(--bg-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-dark);
  margin: 0 0 0.4em;
}

p { margin: 0 0 1em; }

/* ---------- 3. LAYOUT ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: var(--container-narrow); }

.section {
  padding: 56px 0;
}
.section--soft   { background: var(--bg-soft); }
.section--accent {
  background: var(--bg-accent);
  color: var(--text-light);
}

.section__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.section__eyebrow--inverse { color: var(--accent-soft); }

.section__title {
  font-size: clamp(28px, 4vw, 40px);
  max-width: 22ch;
  margin-bottom: 20px;
}
.section__title--inverse { color: var(--text-light); }

.section__lead {
  font-size: 19px;
  color: var(--text-soft);
  max-width: 60ch;
  margin-bottom: 48px;
}
.section__lead--inverse { color: var(--accent-soft); }

.prose p { color: var(--text-soft); font-size: 17px; }
.prose strong { color: var(--text-dark); }

/* ---------- 4. NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
  font-weight: 600;
}
.nav__brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-block;
  width: 34px;
  height: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='18' fill='%23C8553D'/><g transform='translate(5, 66) scale(0.0211, -0.0211)' fill='%23FAF6EF'><path d='M1954 0h-1410q-81 0 -152 31q-72 31 -126 84t-85 125q-31 71 -31 152v1108h318v-1108q0 -30 22 -53t54 -23h1410v-316z'/><path d='M2002 984q0 -81 -31 -152q-31 -72 -85 -126t-125 -85q-72 -31 -153 -31h-1140v-590h-318v908h1458q30 0 53 22t23 54v122q0 32 -23 54t-53 22h-1458v318h1458q81 0 153 -31q71 -31 125 -85t85 -125q31 -72 31 -153v-122z' transform='translate(2104, 0)'/></g></svg>");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  font-size: 0;
  color: transparent;
  border-radius: var(--radius-sm);
  vertical-align: middle;
}
.brand-name { font-size: 16px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__links a {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
}
.nav__links a:hover {
  color: var(--text-dark);
  text-decoration: none;
}
.nav__cta {
  background: var(--accent);
  color: var(--text-light) !important;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.nav__cta:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

/* Theme toggle (sole/luna) nel nav */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  transform: rotate(15deg);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mostra il sole di default (tema chiaro), nasconde la luna */
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }

/* Tema dark forzato dall'utente */
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Dark dal sistema, se l'utente non ha scelto light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* ---------- 5. HERO ---------- */
.hero {
  padding: 64px 0 48px;
  background:
    radial-gradient(800px 400px at 80% -10%, var(--hero-glow) 0%, transparent 60%),
    var(--bg-cream);
}
.hero__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero__title {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  max-width: 16ch;
}
.hero__title em {
  font-style: italic;
  color: var(--accent);
}
.hero__lead {
  font-size: 19px;
  color: var(--text-soft);
  max-width: 56ch;
  margin-bottom: 36px;
}

/* ============= Scroll indicator: chevron in basso al hero (SOLO MOBILE) ============= */
.hero { position: relative; }
.hero__scroll {
  position: absolute;
  left: 50%;
  /* freccia: tirata in alto di 32 px (doppio del tiro applicato al blocco
     CTA, che è di 16 px) — ora c'è spazio sotto per ospitarla più in alto. */
  bottom: max(35px, calc(env(safe-area-inset-bottom, 0px) + 21px));
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  display: none; /* nascosto di default, visibile solo su mobile */
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.95;
  text-decoration: none;
  border-radius: 50%;
  /* cerchio terracotta in trasparenza lieve, per dare risalto alla freccia */
  background: rgba(200, 85, 61, 0.10);
  border: 1px solid rgba(200, 85, 61, 0.18);
  z-index: 3;
  animation: heroScrollBounce 1.8s ease-in-out infinite;
  transition: opacity 0.35s ease, background 0.2s ease, border-color 0.2s ease;
}
@media (max-width: 768px) {
  .hero__scroll { display: flex; }
}
/* Classe applicata via JS quando l'utente scrolla giù: dissolvenza */
.hero__scroll--hidden {
  opacity: 0;
  pointer-events: none;
}
.hero__scroll:hover, .hero__scroll:focus-visible {
  opacity: 1;
  background: rgba(200, 85, 61, 0.22);
  border-color: rgba(200, 85, 61, 0.32);
}
.hero__scroll svg { width: 30px; height: 30px; }
@keyframes heroScrollBounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%     { transform: translate(-50%, 14px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__scroll { animation: none; }
}

/* ============= Divider tra i CTA del hero (terracotta, ben visibile) ============= */
.hero__actions { align-items: center; }
.hero__actions-divider {
  display: inline-block;
  width: 2px;
  height: 36px;
  background: var(--accent);
  opacity: 0.7;
  border-radius: 2px;
  margin: 0 6px;
}
/* su mobile teniamo i due CTA affiancati: il divider resta visibile.
   Su schermi davvero stretti (< 360px) lo nascondiamo per dare aria ai bottoni. */
@media (max-width: 360px) {
  .hero__actions-divider { display: none; }
}

/* Link "Leonardo Paiola" nel lead dell'hero: terracotta + sottolineatura
   animata da sinistra su hover, porta alla sezione Chi sono */
.hero__name-link {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
  position: relative;
  display: inline-block;
}
.hero__name-link:hover,
.hero__name-link:focus {
  text-decoration: none;
}
.hero__name-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hero__name-link:hover::after,
.hero__name-link:focus-visible::after {
  transform: scaleX(1);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Mobile: i due CTA restano affiancati (sinistra-destra), così c'è spazio sotto
   per la freccia scroll senza che la barra indirizzo Safari la copra. */
@media (max-width: 600px) {
  .hero__actions {
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
  }
  .hero__actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 10px;
    font-size: 14px;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
  }
  .hero__actions-divider {
    height: 32px;
    margin: 0 2px;
    flex: 0 0 auto;
  }
}

/* ---------- 6. BOTTONI ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--accent);
  color: var(--text-light);
}
.btn--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  color: var(--text-dark);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-card);
  border-color: var(--text-mute);
}

/* ---------- 7. STEPS (Come lavoro) ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.step {
  background: var(--bg-card);
  padding: 28px 26px 30px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.step__num {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  border-radius: 50%;
  margin-bottom: 16px;
}
.step__title {
  font-size: 20px;
  margin-bottom: 10px;
}
.step__body {
  color: var(--text-soft);
  font-size: 15.5px;
  margin: 0;
}

.promise {
  margin: 40px 0 0;
  padding: 22px 26px;
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 17px;
  color: var(--text-soft);
  max-width: 65ch;
  box-shadow: var(--shadow-sm);
}
.promise strong { color: var(--text-dark); }

/* ---------- 8. GRID PROGETTI ---------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid--projects {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  color: var(--text-dark);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.card__media {
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
}
.card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.4s ease;
}
.card__media .card__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.card:hover .card__media img {
  transform: scale(1.04);
}
.card__placeholder {
  color: var(--text-mute);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card__body {
  padding: 20px 22px 24px;
}
.card__tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 6px;
}
.card__title {
  font-size: 19px;
  margin-bottom: 6px;
}
.card__excerpt {
  color: var(--text-soft);
  font-size: 15px;
  margin: 0;
}

/* ---------- 9. CONTATTI ---------- */
.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 8px 0 32px;
}
.contact {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  background: rgba(250, 246, 239, 0.1);
  border: 1px solid rgba(250, 246, 239, 0.3);
  border-radius: var(--radius-md);
  color: var(--text-light);
  transition: all 0.2s ease;
}
.contact:hover {
  background: rgba(250, 246, 239, 0.18);
  border-color: rgba(250, 246, 239, 0.5);
  text-decoration: none;
}
.contact--primary {
  background: var(--text-light);
  color: var(--accent-dark);
  border-color: var(--text-light);
}
.contact--primary:hover {
  background: #fff;
  color: var(--accent-dark);
}
.contact__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  opacity: 0.85;
}
.contact__value {
  font-size: 18px;
  font-weight: 600;
  margin-top: 4px;
}
.contacts__zone {
  font-size: 15px;
  color: var(--accent-soft);
  margin: 0;
}

/* ---------- 10. FOOTER ---------- */
.footer {
  background: var(--bg-cream);
  padding: 36px 0 40px;
  border-top: 1px solid var(--border-soft);
}
.footer__line {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0 0 6px;
}
.footer__fine {
  color: var(--text-mute);
  font-size: 12.5px;
  margin: 0;
  max-width: 70ch;
}

/* ---------- 10b. ALERT BANNER (es. Win10 EOS) ---------- */
.alert {
  background: var(--accent);
  color: var(--text-light);
  padding: 36px 0;
}
.alert__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin: 0 0 10px;
}
.alert__title {
  color: var(--text-light);
  font-size: clamp(26px, 4vw, 38px);
  margin-bottom: 14px;
  max-width: 22ch;
}
.alert__body {
  color: var(--accent-soft);
  font-size: 17px;
  max-width: 60ch;
  margin-bottom: 24px;
  line-height: 1.6;
}
.alert__body strong { color: var(--text-light); }

.btn--alert {
  background: var(--text-light);
  color: var(--accent-dark);
  border-color: var(--text-light);
}
.btn--alert:hover {
  background: #fff;
  color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ---------- 10c. SERVICE CARDS (categorie servizi) ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.svc-card {
  background: var(--bg-card);
  padding: 28px 28px 26px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.svc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.svc-card__num {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.svc-card__title {
  font-size: 21px;
  margin-bottom: 10px;
  line-height: 1.25;
}
.svc-card__lead {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 16px;
  line-height: 1.55;
}
.svc-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.svc-card__list li {
  font-size: 14px;
  color: var(--text-dark);
  padding: 5px 0 5px 22px;
  position: relative;
  line-height: 1.45;
}
.svc-card__list li::before {
  content: "\2714\FE0E";
  font-variant-emoji: text;
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- 11. RESPONSIVE ---------- */
@media (max-width: 720px) {
  .nav__links a:not(.nav__cta) { display: none; }
  .section { padding: 40px 0; }
  .hero { padding: 40px 0 84px; }
  .hero__title { letter-spacing: -0.005em; }
  /* su mobile riduciamo il margin-bottom del lead per alzare di ~16 px
     il blocco dei CTA (Scrivimi su WhatsApp / Guarda i miei lavori) */
  .hero__lead { margin-bottom: 20px; }
}

/* ---------- 12. SUPPORTO PROGETTO SINGOLO ---------- */
/* (Stili usati anche da progetti/_template.html) */
.project-page {
  padding: 72px 0;
}
.project-page__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 24px;
}
.project-page__back:hover { color: var(--accent); text-decoration: none; }
.project-page__meta {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.project-page__title {
  font-size: clamp(30px, 5vw, 44px);
  margin-bottom: 32px;
  max-width: 24ch;
}
.project-page h3 {
  font-size: 22px;
  margin-top: 36px;
  margin-bottom: 10px;
}
.project-page__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 24px 0 36px;
}
.project-page__gallery .card__media,
.project-page__gallery img {
  border-radius: var(--radius-md);
}
.project-page__gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  transition: transform 0.25s ease;
}
.project-page__gallery img:hover {
  transform: scale(1.02);
}

/* Stats: Materiali & Tempo */
.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin: 28px 0 24px;
  padding: 18px 24px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
}
.project-stats__item {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}
.project-stats__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.project-stats__value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  font-family: var(--font-heading);
}
.project-stats__note {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
  font-style: italic;
}

/* Legal page (Termini e condizioni) */
.legal__intro {
  font-size: 18px;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 6px;
}
.legal__updated {
  font-size: 13px;
  color: var(--text-mute);
  font-style: italic;
  margin-bottom: 36px;
}
.project-page ul {
  color: var(--text-soft);
  padding-left: 22px;
  margin: 0 0 16px;
}
.project-page ul li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Project page: blocco "nota tecnica" / aside */
.project-page__aside {
  margin: 36px 0 8px;
  padding: 20px 24px;
  background: var(--bg-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.65;
}
.project-page__aside strong { color: var(--text-dark); }

/* Footer link */
.footer__fine a {
  color: var(--text-soft);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}
.footer__fine a:hover { color: var(--accent); }

/* Video dell'intervento */
.project-video {
  margin: 8px 0 36px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
  position: relative;
}
.project-video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  background: #000;
}
.project-video--vertical video {
  /* Per video verticali (mobile), limita a larghezza ragionevole e centra */
  max-width: 480px;
  margin: 0 auto;
  max-height: 80vh;
}
.project-video--vertical {
  background: transparent;
  box-shadow: none;
  border: none;
}
.project-video__caption {
  font-size: 13px;
  color: var(--text-mute);
  font-style: italic;
  text-align: center;
  margin: -28px 0 32px;
}

/* ===================== HIGHLIGHT PAROLE CHIAVE NEI PROGETTI ===================== */

/* Strong dentro i paragrafi e l'aside delle pagine progetto diventa
   terracotta semi-bold per fare da "punto di sosta" allo scroll */
.project-page p strong,
.project-page__aside strong {
  color: var(--accent-dark);
  font-weight: 600;
}

/* ===================== LIGHTBOX FOTO PROGETTI ===================== */

/* Cursore zoom sulle foto cliccabili */
.project-page__gallery img {
  cursor: zoom-in;
  transition: transform 0.18s ease;
}
.project-page__gallery img:hover {
  transform: translateY(-2px);
}

/* Overlay a tutto schermo */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(26, 22, 18, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.lightbox--visible {
  opacity: 1;
  visibility: visible;
}

/* Immagine ingrandita: animazione di scale-in */
.lightbox__img {
  max-width: min(92vw, 1600px);
  max-height: 84vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  object-fit: contain;
}
.lightbox--visible .lightbox__img {
  transform: scale(1);
}
/* Disabilita la transition durante zoom/pan utente per evitare lag */
.lightbox__img--interactive {
  transition: none !important;
  will-change: transform;
}

/* Bottone X di chiusura in alto a destra */
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(250, 246, 239, 0.12);
  color: #FAF6EF;
  font-size: 32px;
  font-family: var(--font-body);
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox__close:hover {
  background: var(--accent);
  transform: rotate(90deg);
}
.lightbox__close:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

/* Hint testuale in basso */
.lightbox__hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 12.5px;
  color: rgba(250, 246, 239, 0.55);
  letter-spacing: 0.02em;
  font-family: var(--font-body);
  text-align: center;
}

/* Mobile: nascondi hint per non occupare spazio prezioso */
@media (max-width: 600px) {
  .lightbox {
    padding: 16px 12px;
  }
  .lightbox__img {
    max-height: 86vh;
  }
  .lightbox__hint {
    display: none;
  }
  .lightbox__close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
}
