<%- content_for :title, node_title(@node) %>

<% video_attachment = @node.attachments.select { |a| a.asset&.file&.video? }[0] %>

<div class="hero-container" data-controller="intro">
  <% if video_attachment %>
    <%= video_tag rails_storage_proxy_path(video_attachment.asset.file),
                  autoplay: true,
                  muted: true,
                  loop: false,
                  playsinline: true,
                  preload: "auto",
                  data: { intro_target: "video" } %>

    <article>
      <%= video_attachment.body.html_safe %>
    </article>
  <% end %>

  <%= link_to url_for(action: "stage", id: 1), class: "hero-link", "aria-label": t("game.got_it_lets_get_started"), data: { intro_target: "link" } do %><% end %>
</div>