.service-card {
  --accent: var(--heart);
  position: relative;
  min-height: 0;
  padding: 14px 16px 13px;
  border-radius: 20px;
  border: 1px solid rgba(62,51,45,.16);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, opacity .2s ease, filter .2s ease;
  flex: 1 1 0;
  display: flex;
}

body.dark .service-card {
  background: rgba(28,22,30,.88);
  border-color: rgba(255,255,255,.13);
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
  opacity: .9;
  pointer-events: none;
}

.service-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 6px;
  width: 100%;
  background: var(--accent);
}

.service-card:hover,
.service-card.active {
  transform: translateY(-4px) scale(1.012);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  z-index: 20;
}

.service-card.hidden {
  display: none;
}

.service-card.dimmed {
  opacity: .22;
  filter: grayscale(1);
}

.service-card.dimmed.active {
  opacity: 1;
  filter: none;
}

.card-content {
  position: relative;
  z-index: 1;
  min-width: 0;
  width: 100%;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill.category {
  color: white;
  background: var(--accent);
}

.pill.stage {
  color: var(--carbon);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(62,51,45,.13);
}

body.dark .pill.stage {
  color: white;
  background: rgba(255,255,255,.12);
}

.service-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.18;
  letter-spacing: -.01em;
  font-weight: 900;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* JS adds density classes for cells with multiple cards */
.stage-cell.compact .service-card {
  padding: 12px 14px;
}

.stage-cell.compact .service-card h3 {
  font-size: 14px;
  -webkit-line-clamp: 2;
}

.stage-cell.compact .service-card p {
  font-size: 11px;
  -webkit-line-clamp: 1;
}

.stage-cell.dense .service-card {
  padding: 10px 12px;
}

.stage-cell.dense .service-card h3 {
  font-size: 12px;
  line-height: 1.12;
  -webkit-line-clamp: 2;
}

.stage-cell.dense .service-card p {
  display: none;
}

.stage-cell.dense .pill {
  font-size: 8px;
  padding: 3px 6px;
}

.service-card.ai { --accent: var(--calm); }
.service-card.data { --accent: var(--harmony); }
.service-card.cloud { --accent: var(--heart); }
.service-card.security { --accent: var(--hunger); }

.tooltip {
  position: fixed;
  z-index: 80;
  display: none;
  width: 315px;
  padding: 15px 16px;
  border-radius: 20px;
  background: rgba(62,51,45,.94);
  color: white;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.tooltip p {
  margin: 0;
  color: rgba(255,255,255,.82);
  line-height: 1.45;
  font-size: 13px;
}
