/* ==========================================================================
   Feature Pills
   Full-bleed accordion features + synced media crossfade
   ========================================================================== */

:root {
  --color-bg: #000000;
  --color-media-bg: #0a0a0c;
  --color-item: rgba(255, 255, 255, 0.055);
  --color-item-hover: rgba(255, 255, 255, 0.09);
  --color-item-active: rgba(255, 255, 255, 0.08);
  --color-item-border: rgba(255, 255, 255, 0.08);
  --color-item-border-active: rgba(255, 255, 255, 0.12);
  --color-text: #f2f2f4;
  --color-text-soft: rgba(242, 242, 244, 0.72);
  --color-text-muted: rgba(242, 242, 244, 0.42);
  --color-accent: #c8c4ff;
  --color-accent-soft: rgba(200, 196, 255, 0.14);
  --space-item-gap: 10px;
  --content-max-width: 480px;
  --font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Page ---------- */

.page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: var(--color-bg);
}

/* ---------- Block ---------- */

.feature-pills {
  width: 100%;
  flex: 1;
  display: flex;
  opacity: 0;
  will-change: opacity, transform;
}

.feature-pills__layout {
  display: grid;
  grid-template-columns: minmax(320px, 42%) 1fr;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  overflow: hidden;
}

/* ---------- Content column ---------- */

.feature-pills__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.75rem;
  padding: clamp(2rem, 5vh, 4rem) clamp(1.75rem, 5vw, 4.5rem);
  background: var(--color-bg);
}

.feature-pills__header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-inline: 0.15rem;
  max-width: var(--content-max-width);
  width: 100%;
}

.feature-pills__eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.feature-pills__title {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--color-text);
  max-width: 16ch;
}

.feature-pills__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-item-gap);
  list-style: none;
  max-width: var(--content-max-width);
  width: 100%;
}

/* ---------- Feature item ---------- */

.feature-pills__item {
  position: relative;
  border-radius: 0;
  background: var(--color-item);
  border: 1px solid var(--color-item-border);
  overflow: hidden;
  transform-origin: 50% 50%;
  will-change: transform, background-color, border-color;
  transition:
    background-color 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out);
}

.feature-pills__item:hover:not(.is-active) {
  background: var(--color-item-hover);
}

.feature-pills__item.is-active {
  background: var(--color-item-active);
  border-color: var(--color-item-border-active);
}

.feature-pills__trigger {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 1.15rem 0.85rem 1.25rem;
  text-align: left;
  outline: none;
}

.feature-pills__trigger:focus-visible {
  box-shadow:
    inset 0 0 0 2px var(--color-accent-soft),
    inset 0 0 0 1px var(--color-accent);
}

.feature-pills__label {
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--color-text-soft);
  transition: color 0.3s var(--ease-out);
}

.feature-pills__item.is-active .feature-pills__label,
.feature-pills__item:hover:not(.is-active) .feature-pills__label {
  color: var(--color-text);
}

/* Plus icon — hidden while active */
.feature-pills__icon {
  position: relative;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.55;
  transform: scale(1);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.feature-pills__item:hover:not(.is-active) .feature-pills__icon {
  opacity: 0.9;
}

.feature-pills__item.is-active .feature-pills__icon {
  opacity: 0;
  transform: scale(0.55);
  pointer-events: none;
}

.feature-pills__icon-line {
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.feature-pills__icon-line--horizontal {
  width: 12px;
  height: 1.5px;
}

.feature-pills__icon-line--vertical {
  width: 1.5px;
  height: 12px;
  transform-origin: center center;
}

/* ---------- Expandable panel ---------- */

.feature-pills__panel {
  height: 0;
  overflow: hidden;
  will-change: height;
}

.feature-pills__panel-inner {
  padding: 0 1.25rem 1.15rem;
  opacity: 0;
  transform: translateY(6px);
  will-change: opacity, transform;
}

.feature-pills__description {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--color-text-muted);
  max-width: 34ch;
}

.feature-pills__item.is-active .feature-pills__description {
  color: var(--color-text-soft);
}

/* ---------- Media column ---------- */

.feature-pills__media {
  position: relative;
  min-height: 100%;
  height: 100%;
  background: var(--color-media-bg);
  overflow: hidden;
}

.feature-pills__media-stack {
  position: absolute;
  inset: 0;
}

.feature-pills__media-item {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
  pointer-events: none;
}

.feature-pills__media-item.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.feature-pills__media-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  will-change: transform;
}

.feature-pills__media-item.is-active .feature-pills__media-image {
  transform: scale(1);
}

.feature-pills__media-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, transparent 22%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0%, transparent 28%);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .page {
    overflow: auto;
  }

  .feature-pills__layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(42vh, 48vh) auto;
    min-height: 100dvh;
  }

  .feature-pills__content {
    order: 1;
    justify-content: flex-start;
    gap: 1.35rem;
    padding: 1.75rem 1.35rem 2.25rem;
  }

  .feature-pills__media {
    order: 0;
    min-height: 42vh;
    height: auto;
  }

  .feature-pills__list,
  .feature-pills__title,
  .feature-pills__description {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .feature-pills__layout {
    grid-template-rows: minmax(38vh, 42vh) auto;
  }

  .feature-pills__content {
    padding: 1.5rem 1.15rem 2rem;
  }

  .feature-pills__trigger {
    min-height: 46px;
    padding: 0.8rem 1rem 0.8rem 1.1rem;
  }

  .feature-pills__label {
    font-size: 0.9rem;
  }

  .feature-pills__panel-inner {
    padding: 0 1.1rem 1.05rem;
  }

  .feature-pills__description {
    font-size: 0.84rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .feature-pills,
  .feature-pills__item,
  .feature-pills__label,
  .feature-pills__icon,
  .feature-pills__panel,
  .feature-pills__panel-inner,
  .feature-pills__media-item,
  .feature-pills__media-image {
    transition: none !important;
  }
}
