/* Landing, part 2: examples with tabs, mobile sticky CTA and the shared
   motion. Only var(--...) from /brand/tokens.css. */

/* Examples */

.install {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.cmd {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  white-space: nowrap;
  color: var(--color-text);
}

/* The tabs only work with JS; without it every transcript is shown. */
.tabs {
  display: none;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  margin-bottom: var(--space-5);
}

.js .tabs {
  display: inline-flex;
}

.tabs button {
  font: inherit;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem var(--space-4);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-clear);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tabs button[aria-selected="true"] {
  background: var(--color-inverse-bg);
  color: var(--color-inverse-text);
}

.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.demo-panels {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.demo-panel {
  border-radius: var(--radius-lg);
  min-height: 20rem;
}

.demo-panel[hidden] {
  display: none;
}

.demo-notes {
  display: grid;
  gap: var(--space-5);
}

.demo-notes div {
  display: grid;
  gap: 0.35rem;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}

.demo-notes b {
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-lg);
  letter-spacing: -0.02em;
}

/* Mobile sticky CTA, after the hero (JS removes its hidden attribute). */

.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) max(var(--gutter), env(safe-area-inset-right, 0px))
    calc(var(--space-3) + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  transform: translateY(110%);
  transition: transform 0.35s ease;
}

.sticky.show {
  transform: none;
}

.sticky-text {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--font-size-2xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.sticky-text b {
  display: block;
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

@media (max-width: 47.5rem) {
  .js .sticky {
    display: flex;
  }

  .js body {
    padding-bottom: 76px;
  }
}

/* Out of screen the bar carries the hidden attribute, which must win. */
.js .sticky[hidden] {
  display: none;
}

@media (min-width: 56.25rem) {
  .demo {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  }
}

/* Motion: everything is readable at rest; JS adds .in to slide content up
   and grow the bars. Nothing moves with prefers-reduced-motion. */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    transform: translateY(28px);
    transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .js .reveal.in {
    transform: none;
  }

  .js .stagger > * {
    transform: translateY(22px);
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .js .stagger.in > * {
    transform: none;
  }

  .js .stagger.in > :nth-child(2) { transition-delay: 0.08s; }
  .js .stagger.in > :nth-child(3) { transition-delay: 0.16s; }
  .js .stagger.in > :nth-child(4) { transition-delay: 0.24s; }

  .js .bench rect {
    transform: scaleX(0);
    transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .js .bench.in rect {
    transform: none;
  }

  .hero h1 .w {
    display: inline-block;
    animation: word-up 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}

@keyframes word-up {
  from { transform: translateY(0.35em); }
  to { transform: none; }
}
