arwm-pyramid-showcase {
  display: block;
}

.arwm-showcase-section {
  position: relative;
  padding-block: clamp(56px, 7vw, 96px);
  overflow: clip;
  border: 0;
  background: var(--bg);
  scroll-margin-top: calc(var(--header-height) + 16px);
  isolation: isolate;
}

/* Keep the long research page moving at a tighter, consistent chapter rhythm. */
main > .section,
main > .demo-section {
  padding-block: clamp(56px, 7vw, 96px);
}

main > .section .section-heading {
  margin-bottom: clamp(32px, 3.8vw, 52px);
}

main > .evidence-section .section-heading {
  margin-bottom: 25px;
}

main > .resources-section {
  padding-top: 0;
}

.arwm-showcase-shell {
  --arwm-pointer-x: 50%;
  --arwm-pointer-y: 50%;
  --arwm-frame-x: 0px;
  --arwm-frame-y: 0px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.22, 1, .36, 1);
}

.arwm-showcase-shell.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.arwm-showcase-card {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.arwm-showcase-topline {
  min-height: 66px;
  padding: 0 clamp(18px, 2.4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.arwm-showcase-heading,
.arwm-showcase-controls {
  display: flex;
  align-items: center;
}

.arwm-showcase-heading {
  gap: 11px;
  color: var(--ink);
  font-family: "IBM Plex Mono", SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.arwm-showcase-heading::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--memory);
  box-shadow: 0 0 12px color-mix(in srgb, var(--memory) 58%, transparent);
  content: "";
}

.arwm-showcase-controls {
  gap: 18px;
}

.arwm-showcase-status {
  min-width: 76px;
  color: var(--muted);
  font-family: "IBM Plex Mono", SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  letter-spacing: .13em;
  text-align: right;
  text-transform: uppercase;
}

.arwm-showcase-replay {
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font: 700 10px/1 "IBM Plex Mono", SFMono-Regular, Consolas, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.arwm-showcase-replay:hover {
  color: var(--memory);
  background: color-mix(in srgb, var(--memory) 8%, transparent);
  transform: translateY(-1px);
}

.arwm-showcase-replay:focus-visible {
  outline: 2px solid var(--memory);
  outline-offset: 3px;
}

.arwm-showcase-stage {
  position: relative;
  height: 480px;
  overflow: hidden;
  border: 0;
  background: #000;
  isolation: isolate;
}

.arwm-showcase-stage::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--memory) 4%, transparent), transparent);
  pointer-events: none;
  content: "";
}

.arwm-showcase-stage::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    340px circle at var(--arwm-pointer-x) var(--arwm-pointer-y),
    color-mix(in srgb, var(--memory) 13%, transparent),
    transparent 68%
  );
  opacity: 0;
  pointer-events: none;
  content: "";
  transition: opacity 320ms ease;
}

.arwm-showcase-shell.is-complete .arwm-showcase-stage:hover::after {
  opacity: 1;
}

.arwm-showcase-frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  pointer-events: none;
  transform: translate3d(var(--arwm-frame-x), var(--arwm-frame-y), 0) scale(1);
  transform-origin: center;
  transition: transform 420ms cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}

.arwm-showcase-shell.is-complete .arwm-showcase-frame {
  transform: translate3d(var(--arwm-frame-x), var(--arwm-frame-y), 0) scale(1.006);
}

.arwm-showcase-shell.is-attracting .arwm-showcase-heading::before {
  animation: arwm-showcase-attract 850ms cubic-bezier(.22, 1, .36, 1);
}

@keyframes arwm-showcase-attract {
  0% { transform: scale(1); box-shadow: 0 0 10px color-mix(in srgb, var(--memory) 42%, transparent); }
  42% { transform: scale(1.8); box-shadow: 0 0 24px color-mix(in srgb, var(--memory) 78%, transparent); }
  100% { transform: scale(1); box-shadow: 0 0 12px color-mix(in srgb, var(--memory) 58%, transparent); }
}

body.arwm-motion-enhanced .reveal {
  filter: blur(5px);
  transform: translate3d(0, 32px, 0) scale(.992);
  transition:
    opacity 820ms ease,
    transform 920ms cubic-bezier(.18, .82, .2, 1),
    filter 820ms ease;
  will-change: opacity, transform, filter;
}

body.arwm-motion-enhanced .section-heading.reveal {
  transform: translate3d(-24px, 18px, 0);
}

body.arwm-motion-enhanced .reveal.is-visible {
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
}

body.arwm-motion-enhanced .arwm-page-module {
  opacity: .86;
  transform: translate3d(0, 28px, 0);
  transition: opacity 900ms ease, transform 1000ms cubic-bezier(.18, .82, .2, 1);
  will-change: opacity, transform;
}

body.arwm-motion-enhanced .arwm-page-module.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Keep the research-heavy lower half comfortably readable on pure black. */
#evidence,
.demo-section,
.evaluation-section,
.resources-section {
  --ink-soft: #e5e8ed;
  --muted: #afb4bd;
  --muted-dark: #858b94;
}

@media (hover: hover) and (pointer: fine) {
  body.arwm-motion-enhanced .reveal.is-visible:is(
    .metric-card,
    .pillar-card,
    .utility-card,
    .evidence-card,
    .demo-card,
    .method-figure,
    .protocol-band,
    .resource-panel
  ) {
    transition:
      transform 360ms cubic-bezier(.22, 1, .36, 1),
      border-color 260ms ease,
      background-color 260ms ease,
      box-shadow 360ms ease;
  }

  body.arwm-motion-enhanced .reveal.is-visible:is(
    .metric-card,
    .pillar-card,
    .utility-card,
    .evidence-card,
    .demo-card,
    .method-figure,
    .protocol-band,
    .resource-panel
  ):hover {
    z-index: 2;
    transform: translate3d(0, -5px, 0);
    border-color: color-mix(in srgb, var(--memory) 42%, var(--line));
    box-shadow: 0 18px 46px #0005;
  }

  body.arwm-motion-enhanced .figure-trigger img,
  body.arwm-motion-enhanced .video-shell video {
    transition: transform 700ms cubic-bezier(.22, 1, .36, 1), filter 420ms ease;
  }

  body.arwm-motion-enhanced .figure-trigger:hover img,
  body.arwm-motion-enhanced .video-shell:hover video {
    transform: scale(1.018);
    filter: saturate(1.06) contrast(1.02);
  }

  body.arwm-motion-enhanced .button,
  body.arwm-motion-enhanced .header-cta,
  body.arwm-motion-enhanced .resource-link,
  body.arwm-motion-enhanced .text-link {
    transition: color 220ms ease, background-color 220ms ease, transform 300ms cubic-bezier(.22, 1, .36, 1);
  }

  body.arwm-motion-enhanced .button:hover,
  body.arwm-motion-enhanced .header-cta:hover {
    transform: translateY(-2px);
  }

  body.arwm-motion-enhanced .resource-link:hover,
  body.arwm-motion-enhanced .text-link:hover {
    transform: translateX(4px);
  }
}

@media (max-width: 520px) {
  .arwm-showcase-section {
    padding-block: 64px;
  }

  .arwm-showcase-topline {
    min-height: 58px;
    padding-inline: 15px;
    gap: 12px;
  }

  .arwm-showcase-heading {
    font-size: 10px;
    letter-spacing: .1em;
  }

  .arwm-showcase-controls {
    gap: 9px;
  }

  .arwm-showcase-status {
    display: none;
  }

  .arwm-showcase-stage {
    height: 380px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arwm-showcase-shell {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .arwm-showcase-heading::before {
    box-shadow: none;
  }

  .arwm-showcase-replay {
    transition: none;
  }

  .arwm-showcase-frame {
    transform: none !important;
    transition: none;
  }

  .arwm-showcase-stage::after {
    display: none;
  }

  body.arwm-motion-enhanced .arwm-page-module,
  body.arwm-motion-enhanced .reveal,
  body.arwm-motion-enhanced .section-heading.reveal {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }
}
