/* H2 | stile del sito: minimale, tecnico. Font ospitati sul sito (nessuna richiesta a terzi). */

@font-face { font-family: "Space Grotesk"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/dm-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/dm-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/dm-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;

  --ink: #0B1712;
  --ink-soft: #14251D;
  --paper: #F4F7F5;
  --white: #FFFFFF;
  --line: #DCE4DF;
  --line-dark: rgba(255, 255, 255, 0.14);
  --muted: #4B5D54;
  --muted-dark: #9DB3A6;

  --accent: #14B866;       /* verde del logo, versione brillante: pulsanti e linee */
  --accent-deep: #0A7C43;  /* verde per testo e link su fondo chiaro */
  --red: #E5303C;          /* solo per la caldaia negli schemi */

  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 2rem);
  --measure: 62ch;
  --radius: 6px;
  /* ottagono con il vertice in alto, come nel logo */
  --oct: polygon(50% 0, 85.355% 14.645%, 100% 50%, 85.355% 85.355%, 50% 100%, 14.645% 85.355%, 0 50%, 14.645% 14.645%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent-deep); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 3px; }
.hero :focus-visible, .section--ink :focus-visible, .site-footer :focus-visible { outline-color: var(--accent); }

.wrap { width: min(72rem, 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--ink); color: #fff; padding: 0.75rem 1rem; }
.skip:focus { left: 0; }

/* ---------- tipografia ---------- */
h1, h2, h3 { font-family: var(--display); color: inherit; margin: 0; text-wrap: balance; }
h1 { font-weight: 700; font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.06; letter-spacing: -0.028em; }
h2 { font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.05rem); line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-weight: 500; font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.005em; }
p { margin: 0 0 1rem; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.55; max-width: 56ch; }
.muted { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }
.note { color: var(--muted); font-size: 0.95rem; max-width: var(--measure); margin-top: 1.5rem; }

/* ---------- pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.7rem 1.35rem;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font: 500 1rem/1.2 var(--body); text-decoration: none; text-align: center;
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #2AD17D; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-on-ink { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.btn-on-ink:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-soft); }
.btn:hover { text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }

/* ---------- testata ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 0.25rem 0.75rem; padding-block: 0.6rem; }
.brand { display: block; line-height: 0; flex: none; }
.brand img { width: 2.25rem; height: auto; }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 0.9rem; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.85rem; padding: 0.55rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.header-call { display: none; min-height: 2.5rem; padding-block: 0.4rem; font-size: 0.95rem; }

@media (min-width: 760px) {
  .header-row { gap: 0.25rem 1.25rem; }
  .brand img { width: 2.75rem; }
  .nav { gap: 0 1.5rem; }
  .nav a { font-size: 0.95rem; }
  .header-call { display: inline-flex; }
}

/* ---------- hero ---------- */
.hero {
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  color: #EAF2ED;
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { color: #fff; margin-bottom: 1.25rem; max-width: 17ch; }
.hero .lead { color: #B7CCBF; }
.hero-note { color: var(--muted-dark); font-size: 0.95rem; max-width: 52ch; margin: 0; }
.hero-figure { margin: 0; display: grid; gap: 0.9rem; justify-items: center; }
.hero-figure figcaption { font: 400 0.8rem/1.45 var(--mono); color: var(--muted-dark); text-align: center; max-width: 30ch; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 4rem; }
}

/* schema impianto (SVG in linea) */
.diagram { width: min(100%, 27rem); height: auto; display: block; }
.diagram text { font: 400 12.5px var(--body); fill: #E4EEE7; text-anchor: middle; }
.diagram .tag { font: 400 10.5px var(--mono); fill: #8FA89A; }
.diagram .frame { fill: rgba(255, 255, 255, 0.02); stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.2; }
.diagram .frame-inner { fill: none; stroke: rgba(255, 255, 255, 0.1); }
.diagram .box { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 1.4; stroke-linejoin: round; }
.diagram .line { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 1.4; }
.diagram .line-thin { fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 1.2; stroke-linecap: round; }
.diagram .flame { fill: var(--red); }
.diagram .pipe { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.diagram .pipe-hp { stroke: var(--accent); }
.diagram .pipe-boiler { stroke: var(--red); }
.diagram .pipe-out { stroke: #fff; }
.diagram .node { fill: var(--ink); stroke: #fff; stroke-width: 1.4; }

/* un solo momento animato: le tubazioni si disegnano all'apertura della pagina */
@media (prefers-reduced-motion: no-preference) {
  .diagram .pipe { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(0.3, 0.7, 0.2, 1) forwards; }
  .diagram .pipe-hp, .diagram .pipe-boiler { animation-delay: 0.35s; }
  .diagram .pipe-out { animation-delay: 1.25s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- fascia qualifiche ---------- */
.trust { background: var(--white); border-bottom: 1px solid var(--line); }
.trust-grid { display: grid; }
.trust-item { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.trust-item:first-child { border-top: 0; }
.trust-item p { margin: 0; font-size: 0.93rem; color: var(--muted); line-height: 1.5; }
.trust .trust-title { font: 500 1rem/1.3 var(--display); color: var(--ink); margin-bottom: 0.3rem; }

@media (min-width: 900px) {
  .trust-grid { grid-template-columns: repeat(4, 1fr); }
  .trust-item { border-top: 0; padding: 1.6rem 1.5rem; border-left: 1px solid var(--line); }
  .trust-item:first-child { padding-left: 0; border-left: 0; }
}

/* ---------- sezioni ---------- */
.section { background: var(--paper); padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--white { background: var(--white); }
.section--ink { background: var(--ink); color: #EAF2ED; }
.section--ink h2 { color: #fff; }
.section--ink a:not(.btn) { color: var(--accent); }
.section-head { max-width: 46rem; margin-bottom: 2.25rem; }
.section-head h2 + p { margin-top: 0.9rem; color: var(--muted); }

.split { display: grid; gap: 1.5rem; }
@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; }
}

.prose { max-width: var(--measure); }
.prose-long { max-width: 70ch; }
.prose-long h2 { font-size: 1.3rem; margin: 2.25rem 0 0.6rem; }
.prose-long h2:first-child { margin-top: 0; }

/* testata delle pagine interne */
.page-head { background: var(--white); border-bottom: 1px solid var(--line); padding-block: clamp(2rem, 5vw, 3.5rem); }
.page-head h1 { max-width: 22ch; margin-bottom: 1rem; }
.page-head .lead { margin-bottom: 1rem; }
.crumbs { font: 400 0.82rem/1.4 var(--mono); color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--muted); }

/* ---------- servizi ---------- */
.service-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 3rem; }
@media (min-width: 760px) { .service-list { grid-template-columns: 1fr 1fr; } }
.service { display: grid; grid-template-columns: 1rem 1fr; gap: 0 1rem; padding: 1.4rem 0; border-top: 1px solid var(--line); }
.service::before { content: ""; width: 0.8rem; height: 0.8rem; margin-top: 0.42rem; background: var(--accent); clip-path: var(--oct); }
.service h3 { margin-bottom: 0.35rem; }
.service p { margin: 0; color: var(--muted); font-size: 0.98rem; max-width: 46ch; }
.service a { white-space: nowrap; }

/* ---------- fasi di lavoro (una sequenza vera) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 2rem; counter-reset: step; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(5, 1fr); gap: 0 1.5rem; } }
.steps li { counter-increment: step; padding: 1.4rem 0; border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-bottom: 0.9rem;
  font: 400 0.95rem/1 var(--mono); color: var(--accent-deep);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpolygon points='20,1 33.4,6.6 39,20 33.4,33.4 20,39 6.6,33.4 1,20 6.6,6.6' fill='none' stroke='%2314B866' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.steps h3 { margin-bottom: 0.35rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* ---------- dati in riga ---------- */
.facts { margin: 0 0 1.5rem; }
.facts > div { display: grid; gap: 0.2rem 2rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font: 500 1.1rem/1.3 var(--display); }
.facts dd { margin: 0; color: var(--muted); max-width: 52ch; }
@media (min-width: 700px) { .facts > div { grid-template-columns: 11rem 1fr; } }

/* ---------- confronto soluzioni ---------- */
.compare { display: grid; gap: 2.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); }
.option { border-top: 3px solid var(--ink); padding-top: 1.1rem; }
.option-hp { border-top-color: var(--accent); }
.option-boiler { border-top-color: var(--red); }
.option-hybrid { border-top: 3px solid; border-image: linear-gradient(90deg, var(--accent) 50%, var(--red) 50%) 1; }
.option h3 { font: 700 1.3rem/1.2 var(--display); letter-spacing: -0.015em; }
.option dl { margin: 0.5rem 0 0; }
.option dt { margin-top: 1.1rem; font: 400 0.8rem/1.3 var(--mono); color: var(--muted); }
.option dd { margin: 0.2rem 0 0; font-size: 0.98rem; }

/* ---------- elenchi ---------- */
.plain-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.plain-list li { padding: 0.8rem 0; border-top: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 1px solid var(--line); }
.area-list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 0 2rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.area-list li { padding: 0.7rem 0; border-top: 1px solid var(--line); font: 500 1.05rem/1.3 var(--display); }

/* ---------- domande frequenti ---------- */
.faq-list { max-width: 52rem; border-bottom: 1px solid var(--line); }
.faq { border-top: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: 1.1rem 0; cursor: pointer; list-style: none;
  font: 500 1.1rem/1.35 var(--display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.4rem/1 var(--mono); color: var(--accent-deep); flex: none; }
.faq[open] summary::after { content: "\2212"; }
.faq-a { padding-bottom: 1.25rem; max-width: var(--measure); color: var(--muted); }
.faq-a p { margin: 0; }

/* ---------- galleria (compare solo se ci sono foto in config.json) ---------- */
.gallery { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.shot figcaption { margin-top: 0.5rem; font-size: 0.9rem; color: var(--muted); }

/* ---------- piè di pagina ---------- */
.site-footer { background: var(--ink); color: var(--muted-dark); padding-top: clamp(2.5rem, 6vw, 4rem); font-size: 0.95rem; }
.site-footer a { color: #EAF2ED; }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2.5rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand img { width: 3.25rem; height: auto; margin-bottom: 0.9rem; }
.footer-brand p { max-width: 32ch; margin: 0; }
.footer-h { font: 500 0.95rem/1.3 var(--display); color: #fff; margin-bottom: 0.7rem; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { padding: 0.25rem 0; }
.footer-legal { border-top: 1px solid var(--line-dark); padding-block: 1.25rem 1.75rem; font: 400 0.78rem/1.6 var(--mono); }
.footer-legal p { margin: 0; max-width: 90ch; }

/* ---------- barra di contatto su telefono ---------- */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 0.5rem; padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom));
  background: var(--white); border-top: 1px solid var(--line);
}
.callbar .btn { flex: 1; }
@media (max-width: 759px) { body { padding-bottom: 4.9rem; } }
@media (min-width: 760px) { .callbar { display: none; } }

/* ---------- articoli ---------- */
.prose-article { max-width: 44rem; }
.prose-article > .lead { max-width: none; color: var(--ink); margin-bottom: 1.5rem; }
.prose-article h2 { font-size: 1.35rem; margin: 2.25rem 0 0.7rem; }
.prose-article ul { padding-left: 1.25rem; margin: 0 0 1.25rem; }
.prose-article li { margin: 0.5rem 0; }
.prose-article .faq-list { max-width: none; }
.article-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0 3rem; }
@media (min-width: 760px) { .article-list { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); } }
.article-item { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.article-item h3 { font: 700 1.2rem/1.25 var(--display); letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.article-item a { color: var(--ink); text-decoration: none; }
.article-item a:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.article-item p { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.98rem; max-width: 46ch; }
.article-item .muted { font-size: 0.8rem; }
