/* ════════════════════════════════════════════════════
   Case Study Carousel — Talentware × Jitter style
   ════════════════════════════════════════════════════ */

.tw-cs-section {
  --bg:             #ffffff;
  --card-bg:        #f2f1f3;
  --card-bg-hover:  #ebebea;
  --border:         rgba(0,0,0,0.06);
  --border-hover:   rgba(0,0,0,0.12);
  --dark:           #111110;
  --text-primary:   #111110;
  --text-secondary: #5a5a58;
  --text-muted:     #9a9a97;
  --ease-out:       cubic-bezier(0.16,1,0.3,1);
  --shadow-hover:   0 24px 56px rgba(0,0,0,0.07);
  --card-radius:    20px;
}

/* ── Section ── */
.tw-cs-section {
  padding: 96px 0 80px;
  background: var(--bg);
  overflow: hidden;
}

.tw-cs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ── Header ── */
.tw-cs-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 52px;
}

.tw-cs-header-left { flex: 1; }

.tw-cs-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.tw-cs-tag::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--text-muted);
}

.tw-cs-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(1.9rem, 2.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  max-width: 520px;
}

.tw-cs-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 240px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

/* ── Carousel full-bleed ── */
.tw-cs-outer {
  position: relative;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

.tw-cs-outer::before {
  content: '';
  position: absolute;
  top: 0; bottom: 24px; left: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 20%, transparent);
}

.tw-cs-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 8px 80px 36px calc((100vw - 1200px) / 2 + 48px);
  cursor: grab;
  user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tw-cs-track::-webkit-scrollbar { display: none; }
.tw-cs-track:active { cursor: grabbing; }

/* ── Card — larghe come Jitter: 2 visibili + metà terza ── */
.tw-cs-card {
  /* 2 card visibili + gap + metà terza che sporge */
  flex: 0 0 calc(50vw - 80px);
  max-width: 560px;
  scroll-snap-align: start;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  border: none;
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity      0.5s var(--ease-out),
    transform    0.5s var(--ease-out),
    background   0.3s ease,
    box-shadow   0.3s ease;
}

.tw-cs-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.tw-cs-card:hover {
  background: var(--card-bg-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Badge */
.tw-cs-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Icona */
.tw-cs-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #ffffff;
  border: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: background 0.3s ease, border-color 0.3s ease;
  flex-shrink: 0;
}

.tw-cs-card:hover .tw-cs-icon-wrap {
  background: var(--dark);
  border-color: var(--dark);
}

.tw-cs-icon-wrap svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
  display: block;
}

.tw-cs-card:hover .tw-cs-icon-wrap svg { stroke: #ffffff; }

.tw-cs-icon-wrap img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: filter 0.3s ease;
  display: block;
}

.tw-cs-card:hover .tw-cs-icon-wrap img {
  filter: brightness(0) invert(1);
}

/* Titolo */
.tw-cs-card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* Divider */
.tw-cs-divider {
  height: 0.5px;
  background: rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

/* Risultati */
.tw-cs-results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  flex: 1;
}

.tw-cs-results li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tw-cs-dot {
  flex-shrink: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0,0,0,0.18);
  margin-top: 8px;
  transition: background 0.3s;
}

.tw-cs-card:hover .tw-cs-dot { background: var(--dark); }

.tw-cs-results strong {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(0,0,0,0.06);
  border-radius: 6px;
  padding: 1px 6px;
  display: inline-block;
  white-space: nowrap;
}

/* ── Nav ── */
.tw-cs-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 0 48px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.tw-cs-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.tw-cs-nav-btn:hover {
  background: var(--dark);
  border-color: var(--dark);
  color: #ffffff;
  transform: scale(1.06);
}

.tw-cs-nav-btn:active { transform: scale(0.94); }

.tw-cs-nav-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  pointer-events: none;
}

.tw-cs-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.tw-cs-dot-item {
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0,0,0,0.14);
  cursor: pointer;
  transition: width 0.35s var(--ease-out), background 0.25s;
}

.tw-cs-dot-item.active {
  width: 18px;
  background: var(--dark);
}

/* ── CTA ── */
.tw-cs-cta {
  margin-top: 64px;
  padding: 44px 48px;
  background: var(--dark);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  overflow: hidden;
}

.tw-cs-cta::after {
  content: '';
  position: absolute;
  top: -80px; right: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 65%);
  pointer-events: none;
}

.tw-cs-cta-text {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #ffffff;
  max-width: 560px;
  position: relative;
  z-index: 1;
}

.tw-cs-cta-text span {
  color: rgba(255,255,255,0.38);
  font-weight: 400;
}

.tw-cs-cta-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--dark);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.tw-cs-cta-btn:hover {
  transform: translateY(-2px);
  background: #f2f1f3;
  box-shadow: 0 10px 32px rgba(255,255,255,0.15);
}

.tw-cs-cta-btn::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-top: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.tw-cs-cta-btn:hover::after {
  transform: rotate(45deg) translate(2px, -2px);
}

/* ── Fade-up scoped ── */
.tw-cs-fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.tw-cs-fade-up.visible { opacity: 1; transform: translateY(0); }
.tw-cs-header .tw-cs-fade-up:nth-child(2) { transition-delay: 0.07s; }
.tw-cs-header .tw-cs-fade-up:nth-child(3) { transition-delay: 0.14s; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .tw-cs-track { padding-left: 48px; }
}

@media (max-width: 900px) {
  .tw-cs-card { flex: 0 0 calc(80vw); max-width: 480px; }
}

@media (max-width: 768px) {
  .tw-cs-section { padding: 72px 0 64px; }
  .tw-cs-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .tw-cs-desc { max-width: 100%; }
  .tw-cs-card { flex: 0 0 85vw; max-width: 360px; padding: 28px 24px 24px; }
  .tw-cs-container { padding: 0 20px; }
  .tw-cs-track { padding: 8px 20px 24px; }
  .tw-cs-nav { padding: 0 20px; margin-top: 20px; }
  .tw-cs-cta { flex-direction: column; align-items: flex-start; padding: 28px 24px; }
}