/* =========================================================
   DEMO CATALOG + DETAIL PAGES
========================================================= */

/* ---------- Hero intro (shared) ---------- */
.demos-hero {
  padding: 120px 0 28px;
  position: relative;
}
.demos-hero .wrap { text-align: center; }
.demos-hero .label { color: var(--orange); }
.demos-hero h1 {
  font-family: var(--font-h); font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; margin-bottom: 14px;
}
.demos-hero p.lede {
  color: var(--ink-light); max-width: 640px; margin: 0 auto;
  font-size: 1.05rem; line-height: 1.65;
}

/* ---------- Toolbar (search + dropdown) ---------- */
.demos-toolbar { padding: 8px 0 20px; }
.demos-toolbar .wrap {
  display: flex; gap: 14px; align-items: center; justify-content: center;
  flex-wrap: wrap;
}
.demos-search {
  position: relative; flex: 1 1 420px; max-width: 520px;
}
.demos-search input {
  width: 100%; padding: 13px 18px 13px 44px;
  border: 1.5px solid var(--line); border-radius: 50px;
  font-family: var(--font-b); font-size: 0.95rem;
  background: var(--white); color: var(--ink);
  transition: border-color 0.2s;
}
.demos-search input:focus { outline: none; border-color: var(--green); }
.demos-search svg, .demos-search i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--ink-lighter); pointer-events: none;
}

.demos-dropdown { position: relative; flex: 0 0 auto; }
.demos-dropdown-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 1.5px solid var(--line);
  background: var(--white); border-radius: 50px;
  font-family: var(--font-b); font-size: 0.9rem; font-weight: 600;
  color: var(--ink); cursor: pointer; transition: border-color 0.2s, color 0.2s;
  min-height: 46px;
}
.demos-dropdown-btn:hover { border-color: var(--green); color: var(--green); }
.demos-dropdown.open .demos-dropdown-btn { border-color: var(--green); color: var(--green); }
.demos-dropdown-btn .dd-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--ink-lighter);
}
.demos-dropdown-btn .dd-value { color: inherit; }
.demos-dropdown-btn svg { width: 14px; height: 14px; transition: transform 0.2s; }
.demos-dropdown.open .demos-dropdown-btn svg { transform: rotate(180deg); }

.demos-dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 240px; list-style: none; margin: 0; padding: 6px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(26,26,46,.12);
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 20;
}
.demos-dropdown.open .demos-dropdown-menu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.demos-dropdown-item {
  padding: 10px 14px; border-radius: 10px;
  font-size: 0.9rem; color: var(--ink); cursor: pointer;
  transition: background 0.15s;
}
.demos-dropdown-item:hover { background: var(--cream); color: var(--green); }

/* ---------- Active filter bar ---------- */
.active-filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 0 0;
}
.afb-prefix {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--ink-lighter);
}
.afb-chip {
  display: inline-flex; align-items: center;
  padding: 6px 14px; background: var(--green); color: var(--white);
  border-radius: 50px; font-size: 0.85rem; font-weight: 600;
}
.afb-reset {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; color: var(--ink-lighter);
  font-family: var(--font-b); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; padding: 6px 4px;
  transition: color 0.2s;
}
.afb-reset:hover { color: var(--green); }
.afb-reset svg { width: 14px; height: 14px; }

.demos-count {
  color: var(--ink-lighter);
  font-size: 0.85rem; margin: 14px 0 8px;
}

/* ---------- Sections (Netflix-style) ---------- */
.demos-sections { padding: 8px 0 72px; }
.demo-section { margin-bottom: 48px; }
.demo-section:last-child { margin-bottom: 24px; }

.demo-section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; padding: 0 2px;
}
.demo-section-title-wrap {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.demo-section-title {
  font-family: var(--font-h); font-weight: 400;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.2;
  color: var(--ink); margin: 0;
}
.demo-section-count {
  font-size: 0.78rem; font-weight: 600; color: var(--ink-lighter);
  letter-spacing: 0.3px;
}
.demo-section-viewall {
  background: transparent; border: 0; color: var(--green);
  font-family: var(--font-b); font-size: 0.85rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer; padding: 4px 6px; border-radius: 6px;
  transition: gap 0.2s, background 0.2s;
  white-space: nowrap;
}
.demo-section-viewall:hover { gap: 8px; background: var(--green-light); }
.demo-section-viewall svg { width: 14px; height: 14px; }

.demo-section-track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 300px);
  gap: 18px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px 4px 14px;
  scrollbar-width: thin;
}
.demo-section-track::-webkit-scrollbar { height: 6px; }
.demo-section-track::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 6px;
}
.demo-section-track::-webkit-scrollbar-thumb:hover { background: var(--ink-lighter); }
.demo-section-track .demo-card { scroll-snap-align: start; }

/* Featured band: solid grid, not horizontal scroll */
.demo-section-featured .demo-section-title { color: var(--orange); }
.demo-section-featured-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ---------- Grid of demo cards (filter mode) ---------- */
.demos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px; padding: 16px 0 72px;
}
.demo-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  text-decoration: none; color: inherit;
}
.demo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(26,26,46,.09);
  border-color: var(--green-light);
}
.demo-card-media {
  position: relative; aspect-ratio: 16/10;
  background: var(--cream-dark); overflow: hidden;
}
.demo-card-media .play-pill {
  position: absolute; bottom: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.92); color: var(--ink);
  padding: 5px 10px 5px 9px; border-radius: 50px;
  font-size: 0.7rem; font-weight: 700;
  backdrop-filter: blur(4px);
}
.demo-card-media .play-pill svg { width: 10px; height: 10px; color: var(--green); }

/* ----------------------------------------------------------------
   Cover-art (poster editoriale): hook "pain come momento di perdita"
   - setup (prima riga): contesto
   - punch (seconda riga, italic + accent): la perdita concreta
   Palette differenziata per macro-settore → crea cluster visivi in griglia.
---------------------------------------------------------------- */
.cover-art {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; align-items: flex-start; justify-content: flex-start;
  /* top-left dove inizia il testo; bottom-right libero per la play-pill */
  padding: 20px 22px 40px 22px;
  isolation: isolate;
}
.cover-art .cover-hook {
  position: relative; z-index: 2;
  font-family: var(--font-h);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.85vw, 1.32rem);
  line-height: 1.18;
  letter-spacing: -0.005em;
  color: #fff;
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
  text-wrap: balance;
}
.cover-art .cover-setup { display: block; }
.cover-art .cover-punch {
  display: block;
  font-style: italic;
  color: #E6B17A; /* default amber — overridden per macro below */
}
/* Riserviamo spazio in basso-dx alla play-pill: l'ultimo blocco di testo
   (sempre il punch) si ferma prima della pill grazie a un padding inline-end
   sull'ultimo line-box. */
.cover-art .cover-punch::after {
  content: ""; display: inline-block; width: 78px; height: 0;
}
.cover-glyph-svg {
  position: absolute;
  right: -28px; bottom: -28px;
  width: 180px; height: 180px;
  opacity: 0.10;
  z-index: 1;
  pointer-events: none;
  fill: none; stroke: #fff; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
@media (max-width: 640px) {
  .cover-art { padding: 18px 20px 40px 18px; }
  .cover-art .cover-hook { font-size: 1.15rem; gap: 6px; }
  .cover-glyph-svg { width: 140px; height: 140px; right: -24px; bottom: -24px; }

  /* Featured: card a tutta larghezza → cover area grande, serve testo proporzionato */
  .demo-section-featured-grid .cover-art { padding: 22px 22px 48px 22px; }
  .demo-section-featured-grid .cover-art .cover-hook {
    font-size: clamp(1.4rem, 5.4vw, 1.85rem);
    line-height: 1.2;
    gap: 8px;
  }
  .demo-section-featured-grid .cover-art .cover-punch::after { width: 92px; }
  .demo-section-featured-grid .cover-glyph-svg {
    width: 170px; height: 170px; right: -22px; bottom: -22px;
  }
}

/* ---- Palette per macro-settore ---- */

/* Ricettivo — deep forest green + amber */
.cover-macro-ricettivo {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(230,177,122,0.24) 0%, transparent 55%),
    linear-gradient(135deg, #0B2A24 0%, #134239 55%, #1B5E4B 100%);
}
.cover-macro-ricettivo .cover-punch { color: #E6B17A; }

/* Sanitario — sage chiaro + orange (unica palette chiara) */
.cover-macro-sanitario {
  background:
    radial-gradient(ellipse at 15% 85%, rgba(180,91,26,0.14) 0%, transparent 55%),
    linear-gradient(160deg, #E9F0EC 0%, #C8D9D0 55%, #7FA896 100%);
}
.cover-macro-sanitario .cover-hook { color: #2E4A3F; }
.cover-macro-sanitario .cover-punch { color: #B45B1A; }
.cover-macro-sanitario .cover-glyph-svg { stroke: #2E4A3F; opacity: 0.13; }

/* Ristorazione — bordeaux + coral */
.cover-macro-ristorazione {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(232,148,120,0.32) 0%, transparent 55%),
    linear-gradient(140deg, #4A1818 0%, #7A2E2E 55%, #8F3838 100%);
}
.cover-macro-ristorazione .cover-punch { color: #E89478; }

/* Automotive — asfalto + orange */
.cover-macro-automotive {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(214,124,57,0.22) 0%, transparent 55%),
    linear-gradient(135deg, #1F2937 0%, #374151 100%);
}
.cover-macro-automotive .cover-punch { color: #E89D5A; }

/* Professionisti — slate deep + amber */
.cover-macro-professionisti {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(230,177,122,0.22) 0%, transparent 55%),
    linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}
.cover-macro-professionisti .cover-punch { color: #E6B17A; }

/* Servizi-casa — rust/terracotta caldo */
.cover-macro-servizi-casa {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(230,177,122,0.26) 0%, transparent 55%),
    linear-gradient(135deg, #3E1F10 0%, #6E3A1A 55%, #8B4513 100%);
}
.cover-macro-servizi-casa .cover-punch { color: #F5DFC8; }

/* Beauty-benessere — plum/rose elegante */
.cover-macro-beauty-benessere {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(232,168,154,0.26) 0%, transparent 55%),
    linear-gradient(135deg, #3A1A36 0%, #5E2E52 55%, #7E3E6C 100%);
}
.cover-macro-beauty-benessere .cover-punch { color: #E8A89A; }

/* Retail — oro bruciato/oliva caldo */
.cover-macro-retail {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(230,177,122,0.24) 0%, transparent 55%),
    linear-gradient(135deg, #2E2515 0%, #4E3E22 55%, #665A2A 100%);
}
.cover-macro-retail .cover-punch { color: #E6B17A; }

/* Trasversale — ink/charcoal + amber */
.cover-macro-trasversale {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(230,177,122,0.20) 0%, transparent 55%),
    linear-gradient(135deg, #14142B 0%, #2D2D4A 100%);
}
.cover-macro-trasversale .cover-punch { color: #E6B17A; }

/* Manifatturiero — steel blue industriale */
.cover-macro-manifatturiero {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(230,177,122,0.20) 0%, transparent 55%),
    linear-gradient(135deg, #16334A 0%, #2B4F70 100%);
}
.cover-macro-manifatturiero .cover-punch { color: #E6B17A; }

/* Sport-fitness — verde energetico + orange vivido */
.cover-macro-sport-fitness {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(232,157,90,0.30) 0%, transparent 55%),
    linear-gradient(135deg, #0F3A2D 0%, #1E5A45 55%, #2A6A50 100%);
}
.cover-macro-sport-fitness .cover-punch { color: #F5B77A; }

/* Educazione — indigo profondo */
.cover-macro-educazione {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(230,177,122,0.22) 0%, transparent 55%),
    linear-gradient(135deg, #1E1E52 0%, #3A2E72 55%, #4A3C82 100%);
}
.cover-macro-educazione .cover-punch { color: #E6B17A; }

/* Altri-servizi — aubergine/plum */
.cover-macro-altri-servizi {
  background:
    radial-gradient(ellipse at 85% 12%, rgba(230,177,122,0.24) 0%, transparent 55%),
    linear-gradient(135deg, #2A1A3E 0%, #4A2E5E 55%, #5E3E72 100%);
}
.cover-macro-altri-servizi .cover-punch { color: #E6B17A; }

.demo-card-body {
  padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.demo-card-sector {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--orange);
}
.demo-card h3 {
  font-family: var(--font-h); font-weight: 400; font-size: 1.2rem;
  line-height: 1.3; color: var(--ink); margin: 0;
}
.demo-card p {
  font-size: 0.88rem; color: var(--ink-light); line-height: 1.55;
  flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.demo-card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.demo-card-tag {
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 9px; border-radius: 50px;
  background: var(--green-light); color: var(--green);
}

.demos-empty {
  text-align: center; padding: 64px 20px;
  color: var(--ink-lighter);
}
.demos-empty h3 { font-family: var(--font-h); font-weight: 400; margin-bottom: 8px; }

/* =========================================================
   DETAIL PAGE
========================================================= */
.demo-detail-hero {
  padding: 110px 0 32px; background: var(--white);
  border-bottom: 1px solid var(--line);
}
.demo-detail-hero .wrap {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.demo-detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--ink-lighter); font-weight: 600;
  margin-bottom: 14px;
}
.demo-detail-back:hover { color: var(--green); }
.demo-detail-back svg { width: 14px; height: 14px; }

.demo-detail-hero .tags-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.demo-detail-hero .tag-category {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--orange);
  background: var(--orange-light); padding: 4px 10px; border-radius: 50px;
}
.demo-detail-hero .tag-work {
  font-size: 0.72rem; font-weight: 600;
  color: var(--green); background: var(--green-light);
  padding: 4px 10px; border-radius: 50px;
}
.demo-detail-hero h1 {
  font-family: var(--font-h); font-weight: 400;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem); line-height: 1.15; margin-bottom: 8px;
}
.demo-detail-hero .sector {
  font-size: 0.92rem; color: var(--ink-lighter); margin-bottom: 22px;
}
.demo-detail-hero .cta-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px;
}

/* Video embed */
.demo-video-wrap {
  position: relative; width: 100%; aspect-ratio: 16/10;
  border-radius: 14px; overflow: hidden;
  background: var(--ink);
  box-shadow: 0 16px 48px rgba(26,26,46,.15);
}
.demo-video-wrap video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Problem + flow blocks */
.demo-detail-story {
  padding: 56px 0;
  background: var(--cream);
}
.demo-story-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}

.demo-detail-problem {
  padding: 48px 0 24px;
  background: var(--cream);
}
.demo-detail-problem .wrap { max-width: 1600px; }
.demo-detail-problem .story-block {
  max-width: 1100px; margin: 0 auto;
}
.demo-detail-flow {
  padding: 24px 0 56px;
  background: var(--cream);
}
.demo-detail-flow .wrap { max-width: 1600px; }
.demo-detail-flow .label-small {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--green);
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
}
.demo-detail-flow .label-small svg { width: 14px; height: 14px; }
.flow-hook {
  font-family: var(--font-h); font-weight: 400; font-style: italic;
  font-size: 1.4rem; line-height: 1.45; color: var(--ink);
  margin: 0 0 32px;
}
.flow-steps {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
/* When there's an odd number of steps in a 2-col grid, the last card lands
   alone in the left column. Make it span both columns for a clean closer. */
.flow-steps[data-count="3"] .flow-step:last-child,
.flow-steps[data-count="5"] .flow-step:last-child {
  grid-column: 1 / -1;
}
.flow-step {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px 26px;
  display: grid; grid-template-columns: auto 1fr;
  gap: 18px; align-items: start;
}
.flow-step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--orange); color: var(--white);
  font-family: var(--font-b); font-weight: 700;
  font-size: 0.95rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.flow-step-content {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.flow-step-title {
  font-family: var(--font-h); font-weight: 400;
  font-size: 1.08rem; line-height: 1.35; color: var(--ink);
  margin: 0;
}
.flow-step-body {
  color: var(--ink-light); line-height: 1.65; font-size: 0.95rem;
  margin: 0;
}
.flow-step-body p { margin: 0 0 12px; }
.flow-step-body p:last-child { margin-bottom: 0; }
.flow-step-body ul { margin: 8px 0 12px; padding-left: 18px; }
.flow-step-body li { margin: 4px 0; }

.story-block {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px 30px;
}
.story-block .label-small {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
}
.story-block .label-small svg { width: 14px; height: 14px; }
.story-block.problem .label-small { color: #DC2626; }
.story-block.flow .label-small { color: var(--green); }
.story-block h2 {
  font-family: var(--font-h); font-weight: 400;
  font-size: 1.35rem; line-height: 1.3; margin-bottom: 12px;
}
.story-block p {
  color: var(--ink-light); line-height: 1.7; font-size: 0.98rem;
}
.story-block p + p { margin-top: 12px; }
.story-block ul {
  margin: 12px 0 0; padding-left: 20px;
  color: var(--ink-light); line-height: 1.7; font-size: 0.98rem;
}
.story-block li + li { margin-top: 6px; }
.story-block strong { color: var(--ink); font-weight: 600; }
.story-block em { font-style: italic; }
.story-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(0,0,0,0.05); padding: 1px 6px; border-radius: 4px;
  font-size: 0.88em;
}

.faq-answer p + p { margin-top: 10px; }
.faq-answer ul { margin: 10px 0 0; padding-left: 20px; }
.faq-answer li + li { margin-top: 5px; }
.faq-answer strong { color: var(--ink); font-weight: 600; }
.faq-answer em { font-style: italic; }
.faq-answer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(0,0,0,0.05); padding: 1px 6px; border-radius: 4px;
  font-size: 0.88em;
}

/* KPIs: numeri attesi */
.demo-kpis {
  padding: 56px 0; background: var(--white);
  border-top: 1px solid var(--line);
}
.demo-kpis .wrap { max-width: 1600px; }
.demo-kpis h2 {
  text-align: center; font-family: var(--font-h); font-weight: 400;
  font-size: clamp(1.5rem, 2.8vw, 2rem); margin-bottom: 8px;
}
.demo-kpis .lede {
  text-align: center; color: var(--ink-light);
  margin: 0 auto 32px; max-width: 640px; font-size: 0.95rem;
}
.demo-kpis-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.kpi-card {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px 22px;
  text-align: center;
}
.kpi-value {
  font-family: var(--font-h); font-weight: 400;
  font-size: clamp(1.8rem, 3.2vw, 2.4rem); line-height: 1.1;
  color: var(--green); margin-bottom: 8px;
}
.kpi-label {
  font-size: 0.95rem; color: var(--ink); line-height: 1.45;
  font-weight: 500;
}
.kpi-note {
  margin-top: 10px; font-size: 0.8rem; color: var(--ink-light);
  line-height: 1.4; font-style: italic;
}

/* Applications (where else) */
.demo-applications {
  padding: 56px 0; background: var(--white);
}
.demo-applications .wrap { max-width: 880px; }
.demo-applications h2 {
  text-align: center; font-family: var(--font-h); font-weight: 400;
  font-size: clamp(1.5rem, 2.8vw, 2rem); margin-bottom: 8px;
}
.demo-applications .lede {
  text-align: center; color: var(--ink-light);
  margin-bottom: 32px; font-size: 0.98rem;
}
.demo-applications-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.application-item {
  background: var(--green-lighter); border: 1px solid var(--green-light);
  border-radius: 12px; padding: 18px 20px;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 0.92rem; color: var(--ink); line-height: 1.5;
  font-weight: 500;
}
.application-item .bullet {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--green); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; margin-top: 1px;
}

/* FAQs on detail page */
.demo-faqs {
  padding: 56px 0; background: var(--cream);
  border-top: 1px solid var(--line);
}
.demo-faqs .wrap { max-width: 820px; }
.demo-faqs h2 {
  text-align: center; font-family: var(--font-h); font-weight: 400;
  font-size: clamp(1.5rem, 2.8vw, 2rem); margin-bottom: 8px;
}
.demo-faqs .lede {
  text-align: center; color: var(--ink-light);
  margin: 0 auto 28px; max-width: 640px; font-size: 0.95rem;
}
.demo-faqs-list {
  display: flex; flex-direction: column; gap: 10px;
}
.faq-item {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: 0;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--green-light); }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  font-weight: 600; font-size: 1rem; color: var(--ink);
  line-height: 1.4;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary > span { flex: 1; }
.faq-chevron {
  width: 18px; height: 18px; flex-shrink: 0;
  transition: transform 0.2s; color: var(--ink-light);
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); color: var(--green); }
.faq-answer {
  padding: 0 22px 20px 22px;
  color: var(--ink-light); line-height: 1.65; font-size: 0.95rem;
}

/* Related demos carousel */
.demo-related {
  padding: 56px 0 80px; background: var(--cream);
  border-top: 1px solid var(--line);
}
.demo-related h2 {
  font-family: var(--font-h); font-weight: 400;
  font-size: clamp(1.5rem, 2.8vw, 2rem); margin-bottom: 22px;
  text-align: center;
}
.related-scroller {
  position: relative;
}
.related-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 300px);
  gap: 18px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 8px 4px 16px;
  scrollbar-width: thin;
}
.related-track::-webkit-scrollbar { height: 6px; }
.related-track::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.related-track .demo-card { scroll-snap-align: start; }

.related-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--line);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
  transition: all 0.2s;
}
.related-arrow:hover { border-color: var(--green); color: var(--green); }
.related-arrow svg { width: 18px; height: 18px; }
.related-arrow.prev { left: -8px; }
.related-arrow.next { right: -8px; }
@media (min-width: 768px) {
  .related-arrow { display: flex; }
}

/* Final CTA (detail page) */
.demo-final-cta {
  padding: 56px 24px;
  background: var(--green); color: var(--white);
  text-align: center;
}
.demo-final-cta h2 {
  font-family: var(--font-h); font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 10px; color: var(--white);
}
.demo-final-cta p {
  color: rgba(255,255,255,0.85); margin-bottom: 22px;
  max-width: 560px; margin-left: auto; margin-right: auto;
}
.demo-final-cta-buttons {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.demo-final-cta .btn {
  background: var(--white); color: var(--green);
  padding: 15px 30px;
}
.demo-final-cta .btn:hover { background: var(--cream); transform: translateY(-1px); }
.demo-final-cta .btn-outline {
  background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.6);
}
.demo-final-cta .btn-outline:hover { background: rgba(255,255,255,.1); color: var(--white); }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 900px) {
  .demo-detail-hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .demo-story-grid { grid-template-columns: 1fr; }
  .demo-kpis-grid { grid-template-columns: 1fr; }
  .flow-steps,
  .flow-steps[data-count="3"],
  .flow-steps[data-count="5"] { grid-template-columns: 1fr; }
  .flow-hook { font-size: 1.2rem; }
}
@media (max-width: 600px) {
  .demos-grid { grid-template-columns: 1fr; }
  .demos-toolbar .wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .demos-search { flex: 0 0 auto; max-width: none; }
  .demos-dropdown { width: 100%; }
  .demos-dropdown-btn { width: 100%; justify-content: space-between; }
  .demos-dropdown-menu { left: 0; right: 0; }
  .demo-section-header { flex-wrap: wrap; }
  .demo-section-featured-grid { grid-template-columns: 1fr; }
  .demo-section-track { grid-auto-columns: minmax(240px, 260px); gap: 14px; }
  .demo-detail-hero { padding-top: 90px; }
}

/* Loading placeholder */
.demo-loading {
  padding: 140px 20px; text-align: center; color: var(--ink-lighter);
}

/* Discover CTA — sopra il banner settori */
.demos-discover-cta {
  background: linear-gradient(135deg, #fff 0%, var(--orange-light, #f5dfc8) 100%);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}
.demos-discover-cta .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.ddc-text { flex: 1; min-width: 280px; }
.ddc-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--orange); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 10px;
}
.ddc-pill i, .ddc-pill svg { width: 12px; height: 12px; }
.demos-discover-cta h2 {
  font-family: var(--font-h); font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  margin: 0 0 6px; color: var(--ink); line-height: 1.25;
}
.demos-discover-cta p {
  margin: 0; color: var(--ink-light); line-height: 1.5; font-size: .95rem;
  max-width: 580px;
}
.ddc-btn {
  white-space: nowrap; flex-shrink: 0;
  padding: 16px 28px !important;
}
@media (max-width: 768px) {
  .demos-discover-cta .wrap { flex-direction: column; align-items: flex-start; }
  .ddc-btn { width: 100%; justify-content: center; }
}

/* Hub settoriali — banner sopra la toolbar */
.demos-sectors-banner {
  background: var(--green-lighter, #f2f7f5);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.demos-sectors-banner .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px 22px;
}
.dsb-label {
  font-size: .92rem; font-weight: 600; color: var(--ink);
}
.dsb-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.dsb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: .88rem; font-weight: 500; color: var(--ink);
  text-decoration: none;
  transition: border-color .18s, color .18s, background .18s;
}
.dsb-chip:hover {
  border-color: var(--green); color: var(--green); background: #fff;
}
.dsb-chip svg, .dsb-chip i { width: 14px; height: 14px; }
@media (max-width: 600px) {
  .demos-sectors-banner .wrap { flex-direction: column; align-items: flex-start; }
}
