/* ============================================
   PROPERUS BRANCHEN TILES
   Replaces the scrolling marquee with a row
   of interactive tiles that reveal a use-case
   preview on hover.
   ============================================ */

.branchen {
  padding: clamp(4rem, 8vh, 6rem) 0;
  background: linear-gradient(180deg,
    var(--c-bg-deep) 0%,
    rgba(14, 11, 9, 0.97) 50%,
    var(--c-bg-deep) 100%);
  position: relative;
  overflow: hidden;
}

.branchen__inner {
  width: min(1240px, 92%);
  margin: 0 auto;
}

.branchen__head {
  text-align: center;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.branchen__overline {
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  font-weight: 600;
  color: rgba(212, 151, 111, 0.75);
  text-transform: uppercase;
}

.branchen__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
  max-width: 28ch;
}

.branchen__title em {
  font-style: italic;
  background: linear-gradient(135deg, #E8C9A8, #D4976F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 500;
}

/* ---------- TILES GRID ---------- */
.branchen__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border: 1px solid rgba(212, 151, 111, 0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(20, 16, 13, 0.5);
  backdrop-filter: blur(12px);
}

.branchen__tile {
  position: relative;
  padding: 1.6rem 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  border-right: 1px solid rgba(212, 151, 111, 0.08);
  background: linear-gradient(180deg, rgba(20, 16, 13, 0.4), rgba(14, 11, 9, 0.6));
  transition: background 0.4s ease;
  cursor: pointer;
  min-height: 120px;
  text-align: center;
}

.branchen__tile:last-child {
  border-right: none;
}

.branchen__tile-icon {
  width: 2rem;
  height: 2rem;
  color: rgba(212, 151, 111, 0.65);
  transition: color 0.3s ease, transform 0.4s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.branchen__tile-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(250, 250, 250, 0.78);
  margin: 0;
  transition: color 0.3s ease;
}

.branchen__tile:hover {
  background: linear-gradient(180deg,
    rgba(212, 151, 111, 0.12),
    rgba(184, 126, 95, 0.04));
}

.branchen__tile:hover .branchen__tile-icon {
  color: var(--c-magenta);
  transform: scale(1.12) translateY(-2px);
}

.branchen__tile:hover .branchen__tile-name {
  color: var(--c-text-primary);
}

.branchen__tile.is-active {
  background: linear-gradient(180deg,
    rgba(212, 151, 111, 0.18),
    rgba(184, 126, 95, 0.08));
}

.branchen__tile.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--c-magenta),
    transparent);
}

/* ---------- USE-CASE PANEL ---------- */
.branchen__panel {
  margin-top: 1.5rem;
  border: 1px solid rgba(212, 151, 111, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg,
    rgba(24, 19, 16, 0.92),
    rgba(15, 12, 10, 0.96));
  backdrop-filter: blur(28px) saturate(1.3);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 151, 111, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  min-height: 240px;
  position: relative;
}

.branchen__panel-content {
  padding: 2rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.branchen__panel-content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.branchen__panel-label {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  font-weight: 600;
  color: rgba(212, 151, 111, 0.7);
  text-transform: uppercase;
}

.branchen__panel-headline {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--c-text-primary);
}

.branchen__panel-headline em {
  font-style: italic;
  background: linear-gradient(135deg, #E8C9A8, #D4976F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.branchen__panel-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(250, 250, 250, 0.7);
  margin: 0;
  max-width: 52ch;
}

.branchen__panel-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 151, 111, 0.1);
  flex-wrap: wrap;
}

.branchen__panel-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.branchen__panel-stat-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #E8C9A8, #D4976F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.branchen__panel-stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(250, 250, 250, 0.5);
  text-transform: uppercase;
  font-weight: 500;
}

/* Right column: mini mockup */
.branchen__panel-mockup {
  width: clamp(220px, 26vw, 320px);
  background: linear-gradient(180deg,
    rgba(28, 22, 18, 0.6),
    rgba(14, 11, 9, 0.8));
  border-left: 1px solid rgba(212, 151, 111, 0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.branchen__panel-mockup::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 100%;
  background: radial-gradient(ellipse,
    rgba(212, 151, 111, 0.08),
    transparent 60%);
  pointer-events: none;
}

.branchen__mock-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  background: rgba(20, 16, 13, 0.7);
  border: 1px solid rgba(212, 151, 111, 0.1);
  border-radius: 8px;
  font-size: 0.78rem;
  color: rgba(250, 250, 250, 0.85);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.branchen__panel-mockup.is-visible .branchen__mock-row {
  opacity: 1;
  transform: translateX(0);
}
.branchen__panel-mockup.is-visible .branchen__mock-row:nth-child(1) { transition-delay: 0.1s; }
.branchen__panel-mockup.is-visible .branchen__mock-row:nth-child(2) { transition-delay: 0.18s; }
.branchen__panel-mockup.is-visible .branchen__mock-row:nth-child(3) { transition-delay: 0.26s; }

.branchen__mock-icon {
  flex-shrink: 0;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: rgba(212, 151, 111, 0.18);
  border: 1px solid rgba(212, 151, 111, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-magenta);
  font-size: 0.7rem;
}

.branchen__mock-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.branchen__mock-time {
  font-size: 0.65rem;
  color: rgba(250, 250, 250, 0.45);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.branchen__mock-row--ok {
  border-color: rgba(107, 203, 122, 0.25);
  background: rgba(107, 203, 122, 0.06);
}
.branchen__mock-row--ok .branchen__mock-icon {
  background: rgba(107, 203, 122, 0.18);
  border-color: rgba(107, 203, 122, 0.4);
  color: rgba(140, 220, 155, 0.95);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .branchen__grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .branchen__tile:nth-child(4n) {
    border-right: none;
  }
  .branchen__tile {
    border-bottom: 1px solid rgba(212, 151, 111, 0.08);
  }
  .branchen__panel {
    grid-template-columns: 1fr;
  }
  .branchen__panel-mockup {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(212, 151, 111, 0.1);
  }
}

@media (max-width: 600px) {
  .branchen__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .branchen__tile:nth-child(2n) {
    border-right: none;
  }
  .branchen__panel-content {
    padding: 1.5rem 1.5rem 1rem;
  }
}
