/* Apple-style 4-tab screen picker — compact bar like iphone.com */

.features-showcase {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(32rem, 94vw);
  min-height: 0;
  margin: 0 auto;
  padding-bottom: 0.25rem;
  opacity: 0;
  will-change: opacity, transform;
}

.features-showcase__screen-wrap {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  min-height: 0;
  margin-bottom: 0.65rem;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.features-showcase.is-screen-visible .features-showcase__screen-wrap {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.features-showcase__device {
  position: relative;
  flex-shrink: 0;
  height: min(52dvh, 500px);
  width: auto;
  max-width: min(280px, 72vw);
  aspect-ratio: 390 / 844;
  border-radius: 2.25rem;
  border: 2px solid #334155;
  box-shadow:
    0 24px 48px -14px rgba(0, 0, 0, 0.65),
    0 0 32px rgba(59, 130, 246, 0.08);
  overflow: hidden;
  background: #0b121c;
}

.features-showcase__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.97);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.features-showcase[data-showcase-dir="forward"] .features-showcase__img.is-active {
  transform: translate3d(0, 0, 0) scale(1);
}

.features-showcase[data-showcase-dir="back"] .features-showcase__img.is-active {
  transform: translate3d(0, 0, 0) scale(1);
}

.features-showcase[data-showcase-dir="forward"] .features-showcase__img:not(.is-active) {
  transform: translate3d(-14px, 6px, 0) scale(0.97);
}

.features-showcase[data-showcase-dir="back"] .features-showcase__img:not(.is-active) {
  transform: translate3d(14px, 6px, 0) scale(0.97);
}

.features-showcase__img.is-active {
  opacity: 1;
  z-index: 1;
}

/* Compact 4-segment control — Apple scale */
.features-showcase__picker {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.28rem;
  width: 100%;
  max-width: 100%;
  padding: 0.42rem;
  border-radius: 0.85rem;
  background: rgba(28, 36, 48, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 0.55rem;
  flex-shrink: 0;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.features-showcase__tab-indicator {
  position: absolute;
  top: 0.42rem;
  bottom: 0.42rem;
  left: 0;
  width: 0;
  border-radius: 0.65rem;
  background: #f5f5f7;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  transform: translate3d(0, 0, 0);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
}

.features-showcase.is-controls-visible .features-showcase__picker {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.features-showcase__tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 3rem;
  height: auto;
  padding: 0.58rem 0.35rem;
  border: none;
  border-radius: 0.65rem;
  background: transparent;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition:
    color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.features-showcase__tab:hover:not(.is-active) {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
}

.features-showcase__tab.is-active {
  color: #0b121c;
  transform: scale(1.02);
}

.features-showcase__tab:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.features-showcase__tab-icon {
  font-size: 1.05rem;
  line-height: 1;
  transition:
    color 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.features-showcase__tab.is-active .features-showcase__tab-icon {
  color: #3b82f6;
  transform: scale(1.08);
}

.features-showcase__tab-label {
  display: block;
  max-width: 4.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.features-showcase__panels {
  display: grid;
  text-align: center;
  width: 100%;
  max-width: 30rem;
  min-height: 2.75rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.features-showcase.is-controls-visible .features-showcase__panels {
  opacity: 1;
}

.features-showcase__desc {
  grid-area: 1 / 1;
  margin: 0 auto;
  max-width: 30rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #94a3b8;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.features-showcase__desc.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.features-showcase__desc[aria-hidden="true"] {
  visibility: hidden;
}

@media (min-width: 768px) {
  .features-showcase {
    max-width: min(36rem, 90vw);
  }

  .features-showcase__device {
    height: min(58dvh, 560px);
    max-width: min(300px, 42vw);
  }

  .features-showcase__desc {
    font-size: 0.9rem;
  }

  .features-showcase__tab {
    flex-direction: row;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.6rem 0.45rem;
    font-size: 0.72rem;
  }

  .features-showcase__tab-icon {
    font-size: 1.1rem;
  }

  .features-showcase__tab-label {
    max-width: none;
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
  }
}

@media (max-width: 767px) {
  .features-showcase {
    max-width: min(100%, 26rem);
  }

  .features-showcase__device {
    height: min(48dvh, 460px);
    max-width: min(260px, 80vw);
  }

  .features-showcase__picker {
    max-width: 100%;
  }

  .features-showcase__tab {
    min-height: 2.85rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.62rem;
  }

  .features-showcase__tab-icon {
    font-size: 0.98rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .features-showcase__tab-indicator {
    transition: none;
  }

  .features-showcase__screen-wrap,
  .features-showcase__picker,
  .features-showcase__panels,
  .features-showcase__img,
  .features-showcase__tab,
  .features-showcase__desc,
  .features-showcase__tab-icon {
    transition: none;
    transform: none;
  }

  .features-showcase__img.is-active,
  .features-showcase__desc.is-active {
    opacity: 1;
  }

  .features-showcase.is-screen-visible .features-showcase__screen-wrap,
  .features-showcase.is-controls-visible .features-showcase__picker,
  .features-showcase.is-controls-visible .features-showcase__panels {
    opacity: 1;
    transform: none;
  }
}
