/*
  Features 05 — 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-50: #f8fafc;
  --slate-200: #e2e8f0;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --blue-100: #dbeafe;
  --blue-600: #2563eb;
  --violet-100: #ede9fe;
  --emerald-100: #d1fae5;
  --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(--slate-900);
  background-color: var(--white);
  line-height: 1.5;
}

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

.features__inner {
  width: 100%;
  max-width: 56rem;
  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-600);
}

.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;
}

.tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 2.5rem 0 0;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--slate-200);
  background-color: var(--slate-50);
}

.tabs__indicator {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: calc((100% - 0.5rem) / 3);
  border-radius: 999px;
  background-color: var(--white);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 320ms cubic-bezier(0.65, 0, 0.35, 1);
}

.tab {
  position: relative;
  z-index: 1;
  border: none;
  background: none;
  border-radius: 999px;
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  transition: color 200ms ease;
}

.tab:hover {
  color: var(--slate-700);
}

.tab[aria-selected="true"] {
  color: var(--slate-900);
}

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

.panel {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--slate-200);
  padding: 2rem;
}

.panel__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.panel__description {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--slate-600);
}

.panel__media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 8rem;
  border-radius: 0.75rem;
}

.panel__media--blue {
  background-color: var(--blue-100);
}

.panel__media--violet {
  background-color: var(--violet-100);
}

.panel__media--emerald {
  background-color: var(--emerald-100);
}

.mockup {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 10rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.mockup__line {
  display: block;
  height: 0.5rem;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.12);
}

@media (min-width: 640px) {
  .panel {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Motion — the sliding indicator is a transition (near-instant under
   reduced motion, not disabled outright, so the active tab is never
   ambiguous); the panel's entrance keyframe is fully gated below. */
@media (prefers-reduced-motion: reduce) {
  .tabs__indicator {
    transition-duration: 1ms;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes al-features05-panel {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .panel.is-entering {
    animation: al-features05-panel 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}
