/*
  Features 29 — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy these three
  files into any project and open index.html as-is.
*/

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

:root {
  --white: #ffffff;
  --slate-400: #94a3b8;
  --slate-950: #020617;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --border: rgba(255, 255, 255, 0.1);
  --surface: rgba(255, 255, 255, 0.02);
  --surface-active: rgba(255, 255, 255, 0.04);
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--white);
  background-color: var(--slate-950);
  line-height: 1.5;
}

.features {
  padding: clamp(4rem, 3.5rem + 2vw, 6rem) clamp(1rem, 0.3rem + 3vw, 2rem);
}

.features__inner {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
}

.intro {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}

.kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--blue-400);
}

.heading {
  margin: 0.75rem 0 0;
  font-weight: 600;
  font-size: clamp(1.875rem, 1.5rem + 1.9vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--white);
}

.layout {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 2rem;
}

.cards {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  transition:
    transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 300ms ease,
    box-shadow 300ms ease;
}

.card.is-open {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.6);
  background-color: var(--surface-active);
  box-shadow: 0 20px 40px -24px rgba(59, 130, 246, 0.35);
}

.card__heading {
  margin: 0;
}

.trigger {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 1rem;
  border: none;
  border-radius: 1rem;
  background: none;
  padding: 1.25rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  outline: none;
}

.trigger:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.icon-tile {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--slate-400);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-tile svg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-tile.is-open {
  transform: scale(1.05);
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--blue-400);
}

.trigger__label {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--slate-400);
  transition: color 200ms ease;
}

.trigger__label.is-open {
  font-weight: 600;
  color: var(--white);
}

.panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.panel.is-open {
  grid-template-rows: 1fr;
}

.panel__inner {
  overflow: hidden;
}

.panel__text {
  margin: 0;
  padding: 0 1.25rem 1.25rem 4.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--slate-400);
}

.visual-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
}

.visual {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.visual.is-active {
  opacity: 1;
  pointer-events: auto;
}

.visual-badge {
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.visual-badge--blue {
  color: var(--blue-400);
}

.visual-badge--emerald {
  color: #6ee7b7;
}

.visual-security {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.visual-security__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--blue-400);
}

.visual-security__tile svg {
  width: 2rem;
  height: 2rem;
}

.visual-collaboration {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.visual-collaboration__avatars {
  display: flex;
}

.visual-collaboration__avatars span {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 2px solid var(--slate-950);
  margin-left: -0.75rem;
}

.visual-collaboration__avatars span:first-child {
  margin-left: 0;
}

.visual-automation {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.visual-automation__node {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.visual-automation__node span {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
}

.visual-automation__line {
  width: 1.5rem;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
}

.visual-analytics {
  display: flex;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 2.5rem;
}

.visual-analytics span {
  width: 1.5rem;
  border-radius: 0.375rem 0.375rem 0 0;
  background-image: linear-gradient(to top, #2563eb, #60a5fa);
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: repeat(2, 1fr);
    gap: 3.5rem;
  }

  .visual-frame {
    aspect-ratio: auto;
  }
}

/* Motion — the card expand/elevate and visual opacity are functional
   state transitions (see script.js), so they stay on at a near-instant
   duration under reduced motion rather than being removed outright; the
   directional slide keyframes below are purely decorative and fully
   gated. */
@media (prefers-reduced-motion: reduce) {
  .panel,
  .visual,
  .card {
    transition-duration: 1ms;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes al-features29-slide-down {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes al-features29-slide-up {
    from {
      opacity: 0;
      transform: translateY(-18px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .visual.is-active.is-entering-down {
    animation: al-features29-slide-down 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .visual.is-active.is-entering-up {
    animation: al-features29-slide-up 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}
