/* home-sections.css - Sezioni della home sotto lo slider (index.php), restyle 14/11/2026.
   Piano: docs/plans/restyle/03-home.md (+ 01-slider.md punto 8). Componenti da ui.css, animazioni da
   motion.css / ui-motion.js (data-reveal, data-count-to, data-draw, data-sticky-steps); schede in
   assets/js/home-sections.js. Prefisso hm-. Alternanza: slider + fascia formati (ink) / numeri (chiaro) /
   editor (ink) / strumenti (chiaro) / dal DWG alla fustella (ink) / perche' (chiaro) / HVAC (ink) /
   aziende (chiaro con banda scura) / FAQ (chiaro) / CTA (ink). */

/* ------------------------------------------------------------------ 0. base della pagina
   Spostata qui dal vecchio <style> inline di index.php, regole identiche (header, footer e slider
   ci contano). Le classi morte (.hero, .section, .step-*, .benefit-*, .contact-*, .services-cta-*,
   .suite-*, .hvac-cta-link) sono state tolte con il loro markup. */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --bg-body: #f9fafb;
    --bg-card: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --transition: 0.15s ease;
    --ce-primary: #2563EB;
    --ce-primary-dark: #1D4ED8;
    --ce-bg-card: #ffffff;
    --ce-text-primary: #111827;
    --ce-text-secondary: #6b7280;
    --ce-text-muted: #94a3b8;
    --ce-border: #e5e7eb;
    --ce-transition: 0.15s ease;
    --ce-font-heading: 'Poppins', sans-serif;
    --ce-radius-sm: 6px;
}
html.dark {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #60A5FA;
    --bg-body: #09090b;
    --bg-card: #18181b;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #27272a;
    --shadow-sm: none;
    --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
    --ce-primary: #3B82F6;
    --ce-primary-dark: #2563EB;
    --ce-bg-card: #18181b;
    --ce-text-primary: #fafafa;
    --ce-text-secondary: #a1a1aa;
    --ce-text-muted: #71717a;
    --ce-border: #27272a;
}
html { scroll-behavior: smooth; }
body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-body);
    transition: background var(--transition), color var(--transition);
}
h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* ancore interne sotto l'header sticky */
#strumenti, #come-funziona, #faq { scroll-margin-top: 72px; }

/* ------------------------------------------------------------------ comuni */
main > section, main > div { min-width: 0; }
.hm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hm-actions--center { justify-content: center; }
.hm-lead-left { margin-left: 0; text-align: left; }
.ui-btn:hover, a.ui-card:hover, .hm-tool:hover { text-decoration: none; }
.ui-section--ink .ui-btn--ghost, .hm-btn-ink { border-color: rgba(255, 255, 255, .28); color: #f5f5f7; }
a.hm-btn-ink, a.hm-btn-ink:visited { color: #f5f5f7; }
.hm-btn-ink:hover { border-color: #fff; }
.hm-note { margin: 18px auto 0; max-width: 620px; text-align: center; font-size: .9rem; color: var(--ce-text-secondary); }
.ui-section--ink .ui-title { color: var(--ui-ink-text); }

/* ------------------------------------------------------------------ 1. fascia formati (attaccata allo slider) */
.hm-formats {
    position: relative;
    background: var(--ui-ink, #05070d);
    color: var(--ui-ink-muted, #a1a1aa);
    padding: 8px 0 clamp(36px, 5vw, 56px);
    overflow: hidden;
    text-align: center;
}
.hm-formats__k { font-size: .85rem; letter-spacing: .04em; color: #8b8b94; margin-bottom: 14px; padding: 0 16px; }
.hm-marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.hm-marquee__track { display: flex; width: max-content; animation: hm-marquee 48s linear infinite; }
.hm-marquee:hover .hm-marquee__track { animation-play-state: paused; }
.hm-marquee__set { display: flex; flex: none; }
.hm-marquee__item {
    flex: none;
    padding: 0 clamp(22px, 3.5vw, 44px);
    font-family: 'Poppins', sans-serif; font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem); letter-spacing: -.02em; line-height: 1.2;
    color: rgba(245, 245, 247, .38);
    position: relative;
}
.hm-marquee__item::after {
    content: ""; position: absolute; right: -3px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
    border-radius: 50%; background: rgba(96, 165, 250, .45);
}
@keyframes hm-marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }

/* ------------------------------------------------------------------ 2. numeri */
.hm-stats .ui-stat__label { max-width: 220px; margin-left: auto; margin-right: auto; }
.hm-stats__grid { max-width: 980px; margin: 0 auto; }

/* ------------------------------------------------------------------ 3. editor */
.hm-editor .ui-split { gap: clamp(32px, 5vw, 64px); }
.hm-feats { list-style: none; margin: 26px 0 0; display: grid; gap: 14px; }
.hm-feats li { display: flex; gap: 12px; align-items: flex-start; color: var(--ui-ink-muted); line-height: 1.55; }
.hm-feats strong { color: var(--ui-ink-text); font-weight: 700; }
.hm-feats__dot { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--ui-grad); box-shadow: 0 0 12px rgba(96, 165, 250, .6); }
.hm-win { display: block; width: 100%; height: auto; overflow: visible; }
.hm-win__frame { fill: rgba(255, 255, 255, .035); stroke: rgba(255, 255, 255, .14); stroke-width: 1.5; }
.hm-win__bar { fill: rgba(255, 255, 255, .05); }
.hm-win__dot--r { fill: #f87171; } .hm-win__dot--y { fill: #fbbf24; } .hm-win__dot--g { fill: #34d399; }
.hm-win__tool { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .12); }
.hm-win__tool.is-on { fill: rgba(59, 130, 246, .35); stroke: #60a5fa; }
.hm-win__panel, .hm-win__cmd { fill: rgba(255, 255, 255, .04); stroke: rgba(255, 255, 255, .1); }
.hm-win__ph { font: 600 12px Poppins, sans-serif; fill: #f5f5f7; }
.hm-win__lt { font: 400 11px Lato, sans-serif; fill: #a1a1aa; }
.hm-win__cmdt { font: 400 12px ui-monospace, Menlo, Consolas, monospace; fill: #22d3ee; }
.hm-win__dimt { font: 600 12px Poppins, sans-serif; fill: #22d3ee; text-anchor: middle; }
.hm-sw--cut { fill: #f87171; } .hm-sw--crease { fill: #60a5fa; } .hm-sw--dim { fill: #22d3ee; }
.hm-sw--fext { fill: #34d399; } .hm-sw--pad { fill: #22d3ee; }
.hm-ln { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hm-ln--cut { stroke: #f87171; stroke-width: 2.6; }
.hm-ln--crease { stroke: #60a5fa; stroke-width: 2; stroke-dasharray: 7 5; }
.hm-ln--dim { stroke: #22d3ee; stroke-width: 1.4; }
/* la cordonatura (tratteggiata, data-draw-skip) compare in dissolvenza a disegno finito */
html.js-motion .hm-win:not(.is-drawn) .hm-ln--crease { opacity: 0; }
.hm-win.is-drawn .hm-ln--crease { opacity: 1; transition: opacity .6s ease .9s; }

/* ------------------------------------------------------------------ 4. strumenti a schede */
.hm-tabs { min-width: 0; }
.hm-tabs__list {
    display: flex; gap: 8px; justify-content: center;
    margin: 0 auto 28px; padding: 4px;
    overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.hm-tabs__list::-webkit-scrollbar { display: none; }
.hm-tabs__list[hidden] { display: none; }
.hm-tab {
    flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 8px 16px;
    border-radius: 999px; border: 1px solid var(--ce-border);
    background: transparent; color: var(--ce-text-secondary);
    font: 600 .9rem 'Poppins', sans-serif; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.hm-tab:hover { color: var(--ce-text-primary); border-color: var(--ce-primary); }
.hm-tab[aria-selected="true"] { background: var(--ce-text-primary); color: var(--ce-bg-card); border-color: transparent; }
.hm-tab:focus-visible { outline: 3px solid var(--ui-focus, #93c5fd); outline-offset: 2px; }
.hm-tab__n { font-size: .75rem; opacity: .7; }
@media (max-width: 767px) { .hm-tabs__list { justify-content: flex-start; margin-left: -16px; margin-right: -16px; padding: 4px 16px; } }

.hm-panel + .hm-panel { margin-top: 36px; }
.hm-tabs.is-tabs .hm-panel + .hm-panel { margin-top: 0; }
.hm-panel[hidden] { display: none; }
.hm-panel__title { font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; color: var(--ce-text-primary); }
.hm-tabs.is-tabs .hm-panel__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.hm-rail { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 340px)); justify-content: center; }
.hm-tabs.is-tabs .hm-panel:not([hidden]) .hm-rail { animation: hm-panel-in .45s var(--ui-ease, ease) both; }
@keyframes hm-panel-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
/* mobile: le card scorrono di lato DENTRO il contenitore, la pagina no */
@media (max-width: 767px) {
    .hm-rail {
        grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(250px, 82%); justify-content: start;
        overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
        margin: 0 -16px; padding: 4px 16px 14px; scroll-padding: 0 16px;
        -webkit-overflow-scrolling: touch;
    }
    .hm-rail > * { scroll-snap-align: start; }
}
.hm-tool {
    display: flex; flex-direction: column; gap: 10px; min-width: 0;
    padding: 22px; border-radius: var(--ui-r, 18px);
    background: var(--ce-bg-card); border: 1px solid var(--ce-border);
    box-shadow: var(--ui-sh-1);
    color: inherit;
    transition: transform .3s var(--ui-ease, ease), box-shadow .3s var(--ui-ease, ease), border-color .3s;
}
a.hm-tool, a.hm-tool:visited { color: var(--ce-text-primary); }
a.hm-tool:hover { transform: translateY(-4px); border-color: var(--ce-primary); box-shadow: var(--ui-sh-2); }
a.hm-tool:focus-visible { outline: 3px solid var(--ui-focus, #93c5fd); outline-offset: 3px; }
.hm-tool__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hm-tool__ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(37, 99, 235, .1); color: var(--ce-primary); }
.hm-tool__ico svg { width: 24px; height: 24px; }
.hm-tool__title { font-size: 1.05rem; font-weight: 600; line-height: 1.3; color: var(--ce-text-primary); }
.hm-tool__text { flex: 1; font-size: .9rem; line-height: 1.5; color: var(--ce-text-secondary); }
.hm-tool__fmt { font-size: .75rem; letter-spacing: .03em; color: var(--ce-text-secondary); }
.hm-soon { max-width: 820px; margin: 28px auto 0; text-align: center; font-size: .92rem; line-height: 1.6; color: var(--ce-text-secondary); }

/* ------------------------------------------------------------------ 5. dal DWG alla fustella (sticky) */
/* .ui-section--ink ha overflow:hidden, che farebbe della sezione il contenitore di scroll e spegnerebbe
   lo sticky: clip taglia il glow allo stesso modo senza creare un contenitore di scroll. */
.hm-flow.ui-section--ink { overflow: clip; }
.hm-flow__grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.hm-flow__figure { order: -1; min-width: 0; }
.hm-flow__steps { list-style: none; display: grid; gap: 14px; }
.hm-flow__step {
    position: relative; padding: 20px 22px 20px 72px; border-radius: var(--ui-r, 18px);
    background: rgba(255, 255, 255, .04); border: 1px solid var(--ui-ink-line, rgba(255,255,255,.1));
}
.hm-flow__n {
    position: absolute; left: 20px; top: 20px;
    font: 700 1.1rem 'Poppins', sans-serif;
    background: var(--ui-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hm-flow__t { font-size: 1.12rem; font-weight: 600; color: var(--ui-ink-text); margin-bottom: 6px; }
.hm-flow__p { color: var(--ui-ink-muted); line-height: 1.6; font-size: .95rem; }
.hm-fig { display: block; width: 100%; height: auto; }
.hm-fig__bg { fill: rgba(255, 255, 255, .03); stroke: rgba(255, 255, 255, .1); }
.hm-fig__file { fill: rgba(59, 130, 246, .14); stroke: rgba(96, 165, 250, .6); }
.hm-fig__up { fill: none; stroke: #60a5fa; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hm-fig__ft { font: 600 14px Poppins, sans-serif; fill: #f5f5f7; }
.hm-fig__fs { font: 400 11px Lato, sans-serif; fill: #a1a1aa; }
.hm-fig__cut { fill: none; stroke: #f87171; stroke-width: 2.6; stroke-linejoin: round; }
.hm-fig__crease { fill: none; stroke: #60a5fa; stroke-width: 2; stroke-dasharray: 7 5; }
.hm-fig__fext { fill: none; stroke: #34d399; stroke-width: 2.4; }
.hm-fig__pad { fill: rgba(34, 211, 238, .18); stroke: #22d3ee; stroke-width: 2; }
.hm-fig__lt { font: 400 12px ui-monospace, Menlo, Consolas, monospace; fill: #d4d4d8; }
.hm-fig__chip { fill: rgba(52, 211, 153, .15); stroke: rgba(52, 211, 153, .6); }
.hm-fig__ct { font: 700 12px Poppins, sans-serif; fill: #34d399; text-anchor: middle; }
.hm-fig__dl { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .25); }
.hm-fig__dt { font: 700 13px Poppins, sans-serif; fill: #f5f5f7; text-anchor: middle; }
.hm-ph { transition: opacity .5s var(--ui-ease, ease), transform .6s var(--ui-ease, ease); transform-box: fill-box; }

/* desktop con animazioni: figura sticky a destra, le fasi si accendono col passo attivo.
   Senza JS (niente data-active-step), su mobile o con reduced-motion la figura e' completa. */
@media (min-width: 900px) {
    .hm-flow__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; }
    .hm-flow__figure { order: 0; }
    /* figura sticky centrata nella finestra, mai sotto l'header */
    .hm-flow__grid .hm-flow__figure { top: max(calc(var(--hn-h, 64px) + 24px), calc(50vh - 230px)); }
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
    .hm-flow__steps { gap: 0; }
    .hm-flow__step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; background: none; border-color: transparent; padding-left: 64px; }
    .hm-flow__step:last-child { min-height: 50vh; }
    .hm-flow__n { top: 50%; transform: translateY(-50%); margin-top: -36px; }
    html.js-motion .hm-flow__grid[data-active-step] .hm-ph { opacity: .08; }
    html.js-motion .hm-flow__grid[data-active-step="1"] .hm-ph1,
    html.js-motion .hm-flow__grid[data-active-step="2"] :is(.hm-ph1, .hm-ph2),
    html.js-motion .hm-flow__grid[data-active-step="3"] :is(.hm-ph1, .hm-ph2, .hm-ph3),
    html.js-motion .hm-flow__grid[data-active-step="4"] .hm-ph { opacity: 1; }
    html.js-motion .hm-flow__grid[data-active-step="1"] .hm-ph1 { transform: scale(1.04); }
}

/* ------------------------------------------------------------------ 6. perche' */
.hm-why__card .ui-card__text { font-size: .95rem; }
.hm-why__about { margin-top: 32px; text-align: center; color: var(--ce-text-secondary); }
.hm-why__about a { font-weight: 700; }

/* ------------------------------------------------------------------ 7. HVAC */
.hm-hvac__glow { opacity: .8; }
.hm-hvac__ai { margin-right: 6px; vertical-align: 1px; }
.hm-hvac__k { font-size: .9rem; font-weight: 600; letter-spacing: .02em; color: var(--ui-ink-muted); margin-bottom: 14px; }
.hm-sys { list-style: none; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
@media (min-width: 900px) { .hm-sys { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hm-sys__item {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 12px 14px; border-radius: 14px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--ui-ink-text); font-size: .88rem; font-weight: 700; line-height: 1.3;
}
.hm-sys__item svg { flex: none; width: 22px; height: 22px; color: #60a5fa; }
.hm-sys__item:nth-child(3n+2) svg { color: #a78bfa; }
.hm-sys__item:nth-child(3n) svg { color: #22d3ee; }

/* ------------------------------------------------------------------ 8. aziende (banda scura forte su sezione chiara) */
.hm-biz__band {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr);
    padding: clamp(28px, 5vw, 64px);
    border-radius: var(--ui-r-lg, 28px);
    background: linear-gradient(135deg, #0b1230 0%, #05070d 55%, #120a2a 100%);
    color: var(--ui-ink-text, #f5f5f7);
    box-shadow: 0 30px 80px -30px rgba(37, 99, 235, .55);
    --ce-text-primary: #f5f5f7; --ce-text-secondary: #a1a1aa; --ce-primary: #60a5fa;
}
.hm-biz__band .ui-eyebrow { color: var(--ui-cyan, #22d3ee); }
.hm-biz__band .ui-title { color: #f5f5f7; }
.hm-biz__band .ui-lead { color: #c4c4cc; }
.hm-biz__glow {
    position: absolute; inset: -40% -20% auto auto; width: 70%; height: 140%; z-index: -1; pointer-events: none;
    background: radial-gradient(closest-side, rgba(96, 165, 250, .35), transparent), radial-gradient(40% 40% at 30% 70%, rgba(167, 139, 250, .3), transparent);
    filter: blur(20px);
}
.hm-biz__list { list-style: none; display: grid; gap: 14px; }
.hm-biz__item { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.hm-biz__item strong { display: block; color: #f5f5f7; font-family: 'Poppins', sans-serif; font-weight: 600; }
.hm-biz__p { display: block; color: #a1a1aa; font-size: .92rem; line-height: 1.5; }
.hm-biz__ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(59,130,246,.9), rgba(167,139,250,.9)); color: #fff; }
.hm-biz__ico svg { width: 20px; height: 20px; }
.hm-biz .hm-actions { margin-top: 0; }
@media (min-width: 960px) {
    .hm-biz__band { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 48px; align-items: center; }
    .hm-biz__head { grid-row: 1; }
    .hm-biz__list { grid-row: 1 / span 2; grid-column: 2; }
    .hm-biz .hm-actions { grid-column: 1; }
}

/* ------------------------------------------------------------------ 9. FAQ (output di seo_faq_html) */
.hm-faq .seo-faq { padding-top: 0; padding-bottom: 0; }
.hm-faq .seo-faq h2 { font-size: var(--ui-fs-h2, 2rem); letter-spacing: -.03em; margin-bottom: 10px; }
.hm-faq .seo-faq details { background: var(--ce-bg-body, #f9fafb); }
html.dark .hm-faq .seo-faq details { background: #111114; }
.hm-faq__more { max-width: 900px; margin: 20px auto 0; padding: 0 20px; text-align: center; color: var(--ce-text-secondary); }
.hm-faq__more a { font-weight: 700; }

/* ------------------------------------------------------------------ 10. CTA finale */
.hm-end { padding-left: 0; padding-right: 0; }
html.dark .hm-end { border-top: 1px solid var(--ui-ink-line, rgba(255,255,255,.1)); }

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hm-marquee { -webkit-mask-image: none; mask-image: none; }
    .hm-marquee__track { animation: none; width: auto; justify-content: center; }
    .hm-marquee__set { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
    .hm-marquee__set + .hm-marquee__set, .hm-marquee__item.is-rep { display: none; }
    .hm-tool, .hm-tab, .hm-ph { transition: none; }
    a.hm-tool:hover { transform: none; }
    .hm-tabs.is-tabs .hm-panel:not([hidden]) .hm-rail { animation: none; }
    .hm-win.is-drawn .hm-ln--crease, html.js-motion .hm-win:not(.is-drawn) .hm-ln--crease { opacity: 1; transition: none; }
}
