.command-showcase {
  display: block;
}

.command-showcase .eyebrow {
  margin: 0 0 1rem;
  font-size: .68rem;
}

.command-showcase h2 {
  margin: 0 0 1.22rem;
}

.command-showcase .section-summary {
  margin-bottom: 2.25rem;
  font-size: .92rem;
  line-height: 1.65;
}

.command-showcase .section-summary code,
.command-row code {
  display: inline-block;
  padding: .14rem .36rem;
  border: 1px solid rgb(179 153 234 / 19%);
  border-radius: 5px;
  background: rgb(125 94 177 / 15%);
  color: #ddd1f8;
  font-size: .74rem;
  line-height: 1.25;
}

.command-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.command-panel {
  position: relative;
  min-height: 388px;
  padding: 22px 20px 24px;
  border: 1px solid rgb(184 153 232 / 25%);
  border-radius: 18px;
  background: linear-gradient(151deg, rgb(47 34 72 / 74%), rgb(17 12 34 / 78%));
  box-shadow: 0 20px 60px rgb(6 4 15 / 19%);
}

.command-panel-head {
  display: flex;
  align-items: center;
  gap: .72rem;
  margin-bottom: .95rem;
  padding-bottom: .92rem;
  border-bottom: 1px solid rgb(184 153 232 / 15%);
}

.command-panel-head .tool-feature-icon {
  flex: none;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 10px;
}

.command-panel-head h3 {
  font-size: .95rem;
  line-height: 1.25;
}

.command-panel-head p,
.command-panel-list p {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.47;
}

.command-panel-head p {
  margin-top: .16rem;
  font-size: .75rem;
}

.command-panel-list {
  display: grid;
  gap: .88rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.command-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: .12rem;
}

.command-row code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sample-copy {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #d0b9f6;
  transition: opacity .14s ease, background-color .14s ease, color .14s ease;
}

.sample-copy::before {
  width: 14px;
  height: 14px;
  background: currentColor;
  mask: url("/assets/tools/copy.svg") center / contain no-repeat;
  content: "";
}

.sample-copy:hover,
.sample-copy:focus-visible {
  border-color: rgb(183 152 234 / 30%);
  background: rgb(117 87 177 / 29%);
}

.sample-copy[data-copy-state="copied"] { color: #85ebbb; }
.sample-copy[data-copy-state="copied"]::before { mask-image: url("/assets/tools/check.svg"); }
.sample-copy[data-copy-state="unavailable"] { color: #ffbc9e; }

@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .command-panel.visible :is(.command-panel-head, .command-panel-list > li) {
    animation: command-row-enter .46s cubic-bezier(.18, .72, .22, 1)
      calc(var(--reveal-delay, 0ms) + var(--row-delay, 0ms)) backwards;
  }

  .command-panel-list > li:nth-child(1) { --row-delay: 60ms; }
  .command-panel-list > li:nth-child(2) { --row-delay: 120ms; }
  .command-panel-list > li:nth-child(3) { --row-delay: 180ms; }
  .command-panel-list > li:nth-child(4) { --row-delay: 240ms; }

  .reveal-ready .command-panel.visible .command-panel-list > li:focus-within { animation: none; }
  .sample-copy[data-copy-state="copied"]::before { animation: command-copy-pop .26s ease-out; }

  @keyframes command-row-enter {
    from { opacity: .36; translate: 0 8px; }
    to { opacity: 1; translate: 0 0; }
  }

  @keyframes command-copy-pop {
    0% { scale: .75; }
    65% { scale: 1.12; }
    100% { scale: 1; }
  }
}

.command-showcase-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-top: 2.8rem;
}

.command-copy-feedback { color: var(--muted); font-size: .8rem; }

@media (hover: hover) and (pointer: fine) {
  .sample-copy { opacity: .45; }
  .command-panel li:hover .sample-copy,
  .sample-copy:is(:hover, :focus-visible, [data-copy-state]) { opacity: 1; }
}

@media (min-width: 781px) {
  .command-showcase { scroll-margin-top: min(17vh, 152px); }
}

@media (min-width: 781px) and (prefers-reduced-motion: no-preference) {
  .command-panel {
    rotate: var(--panel-angle, -1.8deg);
    transform: translateY(var(--panel-lift, 0px)) perspective(960px) rotateX(var(--panel-rx, 0deg)) rotateY(var(--panel-ry, 0deg));
  }

  .command-panel:nth-child(2) { top: -24px; --panel-angle: 1.6deg; --command-phase: -2.1s; }
  .command-panel:nth-child(3) { top: 16px; --panel-angle: -1.4deg; --command-phase: -4.2s; }

  .reveal-ready .command-panel.visible {
    animation: scene-drift 6.5s ease-in-out var(--command-phase, 0s) infinite;
    animation-play-state: paused;
  }

  .reveal-ready .command-panel.visible.in-viewport:not(:hover, :focus-within) {
    animation-play-state: running;
  }

  .reveal-ready .command-panel.in-viewport {
    transition-property: opacity, translate, transform, rotate;
    transition-duration: .54s, .64s, .23s, .23s;
    transition-timing-function: ease, cubic-bezier(.16, .76, .28, 1), ease-out, ease-out;
    transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0ms, 0ms;
  }

  .reveal-ready .command-panel:is(:hover, :focus-within) {
    rotate: 0deg;
  }
}

@media (max-width: 780px) {
  .command-showcase-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .command-panel { min-height: 0; }
  .command-showcase-footer { margin-top: 1.6rem; }
}

@media (pointer: coarse) {
  .sample-copy { width: 36px; height: 36px; }
}
