/* Studio Tecnico Ing. Lucia Serrapica — foglio di stile unico (v3, 16/08/2026) */

/* ---------- Caratteri (auto-ospitati, sottoinsieme latino) ---------- */
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("fonts/ibm-plex-serif-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("fonts/ibm-plex-serif-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("fonts/ibm-plex-serif-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --petrolio: #0d3b40;
  --petrolio-medio: #14555b;
  --petrolio-chiaro: #e8f1f1;
  --pietra: #c8a24a;
  --pietra-scuro: #a5832f;
  --testo: #1b2629;
  --attenuato: #59696d;
  --fondo: #ffffff;
  --fondo-alt: #f5f8f8;
  --bordo: #dfe9e9;
  --ombra: 0 1px 2px rgba(13,59,64,0.06), 0 8px 24px rgba(13,59,64,0.07);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--testo);
  background: var(--fondo);
  line-height: 1.7;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--petrolio-medio); }
h1, h2, h3, .marchio { font-family: "IBM Plex Serif", Georgia, "Times New Roman", serif; }
h1, h2, h3 { font-weight: 600; }
h1 strong, h2 strong, h3 strong { font-weight: 700; }

/* ---------- Testata ---------- */
header.testata {
  border-bottom: 1px solid var(--bordo);
  position: sticky; top: 0; background: rgba(255,255,255,0.94); backdrop-filter: blur(8px); z-index: 10;
}
.testata-interno {
  max-width: 1100px; margin: 0 auto; padding: 0.75rem 1.2rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.4rem;
}
.marchio { font-weight: 750; color: var(--petrolio); text-decoration: none; font-size: 1.04rem; letter-spacing: -0.01em; }
.marchio span { color: var(--pietra-scuro); }
nav.principale { display: flex; flex-wrap: wrap; gap: 0.1rem 1.05rem; font-size: 0.92rem; margin-left: auto; }
nav.principale a { text-decoration: none; color: var(--attenuato); padding: 0.2rem 0; border-bottom: 2px solid transparent; }
nav.principale a:hover { color: var(--petrolio); }
nav.principale a.attiva { color: var(--petrolio); font-weight: 650; border-bottom-color: var(--pietra); }

/* ---------- Eroe ---------- */
.eroe-sfondo {
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(200,162,74,0.14), transparent 60%),
    linear-gradient(160deg, var(--petrolio) 0%, var(--petrolio-medio) 58%, #1d6a70 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  margin-top: 1.5rem;
  box-shadow: var(--ombra);
}
.eroe-sfondo::after {  /* trama tecnica: isoipse stilizzate */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M0 330 C 90 300 150 360 240 330 S 390 300 420 320'/%3E%3Cpath d='M0 360 C 100 330 170 390 260 360 S 400 330 420 350'/%3E%3Cpath d='M0 390 C 110 360 190 420 280 390 S 410 360 420 380'/%3E%3Ccircle cx='330' cy='90' r='58'/%3E%3Ccircle cx='330' cy='90' r='38'/%3E%3Ccircle cx='330' cy='90' r='18'/%3E%3Cpath d='M60 40 L60 160 M20 100 L100 100' stroke-width='0.8'/%3E%3C/g%3E%3C/svg%3E");
}
.eroe { max-width: 1100px; margin: 0 auto; padding: 4.2rem 1.2rem 3.4rem; position: relative; z-index: 1; }
.eroe .occhiello {
  display: inline-block; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--pietra); font-weight: 700; margin-bottom: 1rem;
}
.eroe h1 { font-size: clamp(1.8rem, 4.4vw, 2.9rem); line-height: 1.16; margin-bottom: 1rem; max-width: 21ch; letter-spacing: -0.015em; }
.eroe p.sotto { font-size: 1.12rem; color: rgba(255,255,255,0.86); margin-bottom: 1.7rem; max-width: 58ch; }
.eroe p.sotto strong { color: #fff; }
.eroe-pagina { padding: 3rem 1.2rem 2.4rem; }
.eroe-pagina h1 { max-width: 26ch; }

.bottoni { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.bottone {
  display: inline-block; padding: 0.7rem 1.35rem; border-radius: 8px;
  text-decoration: none; font-weight: 650; font-size: 0.98rem; transition: transform 0.08s ease, background 0.15s ease;
}
.bottone:active { transform: translateY(1px); }
.bottone.pieno { background: var(--pietra); color: var(--petrolio); }
.bottone.pieno:hover { background: #d9b25c; }
.bottone.vuoto { border: 1.5px solid rgba(255,255,255,0.65); color: #fff; }
.bottone.vuoto:hover { border-color: #fff; }
main .bottone.pieno { background: var(--petrolio-medio); color: #fff; }
main .bottone.pieno:hover { background: var(--petrolio); }
main .bottone.vuoto { border-color: var(--petrolio-medio); color: var(--petrolio-medio); }

/* Dentro la testata i bottoni stanno su una fotografia: restano chiari, sempre.
   Senza questa regola vince quella qui sopra e il bottone vuoto sparisce sul chiaro. */
.eroe .bottone.vuoto { border-color: rgba(255,255,255,0.72); color: #fff; }
.eroe .bottone.vuoto:hover { border-color: #fff; background: rgba(255,255,255,0.14); }

/* ---------- Sezioni ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 0 1.2rem; }
section { padding: 2.6rem 0; }
section.alterna { background: var(--fondo-alt); margin: 0 -1.2rem; padding-left: 1.2rem; padding-right: 1.2rem; }
section.alterna > .interno, .interno { max-width: 1100px; margin: 0 auto; }
h2.titolo-sezione { font-size: 1.55rem; margin-bottom: 0.5rem; color: var(--petrolio); letter-spacing: -0.01em; }
p.sottotitolo-sezione { color: var(--attenuato); margin-bottom: 1.4rem; max-width: 62ch; }
.filo { width: 44px; height: 3px; background: var(--pietra); border-radius: 2px; margin: 0.6rem 0 1.2rem; }

.griglia { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 1.15rem; }
.scheda {
  border: 1px solid var(--bordo); border-radius: 12px; padding: 1.35rem;
  background: var(--fondo); display: flex; flex-direction: column; gap: 0.5rem;
  box-shadow: var(--ombra);
}
.scheda h3 { font-size: 1.1rem; color: var(--petrolio); }
.scheda p { font-size: 0.95rem; color: var(--attenuato); flex: 1; }
.scheda a.rimando { font-size: 0.93rem; font-weight: 650; text-decoration: none; }
.scheda .etichetta {
  align-self: flex-start; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--petrolio-chiaro); color: var(--petrolio-medio); padding: 0.18rem 0.55rem; border-radius: 99px;
}
.scheda .meta { font-size: 0.82rem; color: var(--attenuato); }

/* ---------- Elenchi ---------- */
ul.puntata { list-style: none; display: grid; gap: 0.6rem; margin: 1rem 0; }
ul.puntata li { padding-left: 1.6rem; position: relative; }
ul.puntata li::before {
  content: ""; position: absolute; left: 0; top: 0.52em; width: 0.62em; height: 0.62em;
  background: var(--pietra); border-radius: 2px; transform: rotate(45deg);
}
ol.passi { list-style: none; counter-reset: passo; display: grid; gap: 1rem; margin: 1.2rem 0; }
ol.passi li { counter-increment: passo; padding-left: 2.8rem; position: relative; }
ol.passi li::before {
  content: counter(passo); position: absolute; left: 0; top: 0.05rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--petrolio-medio); color: #fff; font-weight: 700; font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Blog e lavori ---------- */
article.articolo { max-width: 70ch; padding: 2.4rem 0; }
article.articolo h2 { font-size: 1.5rem; color: var(--petrolio); margin-bottom: 0.3rem; }
article.articolo .data { font-size: 0.86rem; color: var(--attenuato); margin-bottom: 1rem; display: block; }
article.articolo p { margin-bottom: 0.9rem; }
article.articolo + article.articolo { border-top: 1px solid var(--bordo); }
.citazione {
  border-left: 3px solid var(--pietra); padding: 0.4rem 0 0.4rem 1.1rem;
  color: var(--attenuato); font-style: italic; margin: 1rem 0;
}

/* ---------- Segnaposto foto ---------- */
.foto-segnaposto {
  border: 2px dashed var(--bordo); border-radius: 12px; background: var(--fondo-alt);
  color: var(--attenuato); font-size: 0.9rem; text-align: center;
  padding: 3.2rem 1rem; margin: 1.3rem 0;
}

/* ---------- Piè di pagina ---------- */
footer { margin-top: 3.2rem; background: var(--petrolio); color: rgba(255,255,255,0.82); font-size: 0.92rem; }
.pie-interno { max-width: 1100px; margin: 0 auto; padding: 2rem 1.2rem; display: grid; gap: 0.45rem; }
.pie-interno strong { color: #fff; font-size: 1rem; }
.pie-interno a { color: var(--pietra); text-decoration: none; }
.pie-interno a:hover { text-decoration: underline; }
.pie-interno .legale { font-size: 0.82rem; color: rgba(255,255,255,0.55); margin-top: 0.4rem; }

/* ---------- Hero con video o foto ---------- */
.eroe-sfondo video.eroe-video, .eroe-sfondo img.eroe-foto {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.eroe-sfondo .velo {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(9,42,46,0.93) 0%, rgba(13,59,64,0.82) 45%, rgba(13,59,64,0.45) 100%);
}
.eroe-sfondo .eroe { position: relative; z-index: 2; }

/* ---------- Fascia fiducia ---------- */
.fascia-fiducia {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; align-items: center;
  padding: 1.1rem 0 0.2rem; color: var(--attenuato); font-size: 0.9rem;
}
.fascia-fiducia span::before { content: "◆ "; color: var(--pietra); font-size: 0.7em; vertical-align: middle; }

/* ---------- Schede con fotografia ---------- */
.scheda-foto { padding: 0; overflow: hidden; }
.scheda-foto img { width: 100%; height: 190px; object-fit: cover; }
.scheda-foto .corpo-scheda { padding: 1.15rem 1.25rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }

/* ---------- Video incorporati ---------- */
.incorpora-video {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 12px; overflow: hidden; background: #000; box-shadow: var(--ombra);
}
.incorpora-video iframe, .incorpora-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.griglia-video { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.3rem; }
.didascalia-video { font-size: 0.92rem; color: var(--attenuato); margin-top: 0.55rem; }
.didascalia-video .quando { display: block; font-size: 0.8rem; margin-top: 0.2rem; opacity: 0.75; }

/* ---------- Galleria ---------- */
.galleria { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.galleria figure { margin: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--ombra); background: var(--fondo); }
.galleria img { width: 100%; height: 230px; object-fit: cover; }
.galleria figcaption { padding: 0.7rem 1rem; font-size: 0.88rem; color: var(--attenuato); }

/* ---------- Citazione grande ---------- */
.citazione-grande {
  max-width: 46ch; margin: 0 auto; text-align: center;
  font-family: "IBM Plex Serif", Georgia, serif; font-weight: 400;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.5; color: var(--petrolio);
  font-style: italic;
}
.citazione-grande strong { color: var(--pietra-scuro); font-style: normal; }
.firma-citazione { text-align: center; margin-top: 1rem; color: var(--attenuato); font-size: 0.95rem; }

/* ---------- Profilo ---------- */
.profilo { display: grid; grid-template-columns: 300px 1fr; gap: 2.2rem; align-items: start; }
.profilo img { width: 100%; border-radius: 14px; box-shadow: var(--ombra); }
.profilo .testo-profilo p { margin-bottom: 0.9rem; }
@media (max-width: 700px) { .profilo { grid-template-columns: 1fr; } .profilo img { max-width: 340px; } }

/* ---------- Modulo contatti ---------- */
.modulo { display: grid; gap: 1rem; max-width: 640px; }
.modulo .riga-doppia { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modulo label { font-weight: 650; font-size: 0.92rem; color: var(--petrolio); display: grid; gap: 0.35rem; }
.modulo input, .modulo textarea {
  font: inherit; padding: 0.65rem 0.85rem; border: 1.5px solid var(--bordo); border-radius: 8px;
  background: var(--fondo); color: var(--testo); width: 100%;
}
.modulo input:focus, .modulo textarea:focus { outline: none; border-color: var(--petrolio-medio); box-shadow: 0 0 0 3px rgba(20,85,91,0.12); }
.modulo textarea { min-height: 140px; resize: vertical; }
.modulo button {
  font: inherit; font-weight: 650; padding: 0.75rem 1.5rem; border: 0; border-radius: 8px;
  background: var(--petrolio-medio); color: #fff; cursor: pointer; justify-self: start;
}
.modulo button:hover { background: var(--petrolio); }
.nota-modulo { font-size: 0.82rem; color: var(--attenuato); max-width: 60ch; }

@media (max-width: 640px) {
  nav.principale { margin-left: 0; }
  .eroe { padding: 3rem 1.2rem 2.6rem; }
  .modulo .riga-doppia { grid-template-columns: 1fr; }
}

/* ---------- Diario ---------- */
.griglia-diario { columns: 2 360px; column-gap: 1.15rem; }
.voce-diario {
  break-inside: avoid; margin-bottom: 1.15rem;
  border: 1px solid var(--bordo); border-radius: 12px; padding: 1.15rem 1.25rem;
  background: var(--fondo); box-shadow: var(--ombra);
}
.quando-voce { font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pietra-scuro); font-weight: 600; margin-bottom: 0.6rem; }
.voce-diario .incorpora-video { margin-bottom: 0.7rem; }
.foto-voce { border-radius: 8px; margin-bottom: 0.7rem; }
.testo-voce { white-space: pre-line; font-size: 0.93rem; overflow-wrap: anywhere; }
.articolo-voce { margin-top: 0.6rem; font-size: 0.93rem; }
.fonte-voce { margin-top: 0.7rem; font-size: 0.84rem; }
.fonte-voce a { color: var(--attenuato); text-decoration: none; }
.fonte-voce a:hover { color: var(--petrolio); }

/* ---------- Movimento sobrio (v3) ---------- */
.scheda, .galleria figure, .voce-diario, .griglia-video > div .incorpora-video { transition: box-shadow 0.2s ease; }
.scheda:hover, .galleria figure:hover, .voce-diario:hover, .griglia-video > div:hover .incorpora-video {
  box-shadow: 0 2px 4px rgba(13,59,64,0.08), 0 14px 34px rgba(13,59,64,0.14);
}
.scheda-foto img, .galleria img { transition: transform 0.35s ease; }
.scheda-foto:hover img, .galleria figure:hover img { transform: scale(1.025); }
.bottone { transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.bottone:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(13,59,64,0.18); }
.bottone:active { transform: translateY(1px); box-shadow: none; }
a.rimando { transition: color 0.15s ease; }
a.rimando:hover { color: var(--pietra-scuro); }

@media (prefers-reduced-motion: no-preference) {
  /* L'eroe entra in scena al caricamento, un elemento alla volta */
  .eroe > * { animation: salire 0.55s ease both; }
  .eroe > *:nth-child(2) { animation-delay: 0.09s; }
  .eroe > *:nth-child(3) { animation-delay: 0.18s; }
  .eroe > *:nth-child(4) { animation-delay: 0.27s; }
  /* Apparizione allo scorrimento, solo dove il browser la sa fare senza script */
  @supports (animation-timeline: view()) {
    .scheda, .galleria figure, .griglia-video > div, ol.passi li {
      animation: salire linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}
@keyframes salire {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
