/* Homepage hero media slot.
   Today: a finished poster built from real product screens (one 16:9 "screen"
   plus two floating builder windows). Later: the same 16:9 screen plays the
   "Introducing Scale.gg" video once data-video-src is set on .home-hero-media.
   Behaviour: js/home-hero-media.js. Frames, tilt, glint and lightbox come from
   css/shots.css + js/shots.js. Docs: docs/homepage-hero-video.md. */

.home-hero-media {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0;
  align-self: start;
  justify-self: end;
}
.suite-hero-grid > .home-hero-media { margin-top: var(--editorial-visual-offset, 48px); }

/* The stage reserves room below the 16:9 screen for the floating windows.
   Padding is a share of the width, so the layout is stable before images load. */
.hhm-stage {
  position: relative;
  isolation: isolate;
  padding-bottom: 15%;
}
.hhm-stage::before {
  position: absolute;
  z-index: -1;
  inset: 7% -3% 2% 8%;
  content: "";
  border-radius: 30px;
  background: linear-gradient(135deg, var(--lilac, #c5b0f4) 0%, var(--peach, #f3c9b6) 100%);
  opacity: 0.5;
  transform: rotate(-1.6deg);
}

/* ---------------------------------------------------------------- screen */
.hhm-screen {
  position: relative;
  z-index: 1;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  background: #f7f7f3;
}
.hhm-screen > .shot { position: absolute; inset: 0; }
.hhm-screen > .shot .shot-frame {
  display: flex;
  height: 100%;
  flex-direction: column;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(31, 29, 61, 0.06), 0 40px 90px -34px rgba(31, 29, 61, 0.5);
}
.hhm-screen > .shot .shot-chrome { flex: none; }
.hhm-screen > .shot .shot-frame img {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: left top;
}

/* -------------------------------------------------------- floating windows */
.hhm-float {
  position: absolute;
  z-index: 2;
  margin: 0;
}
.hhm-float .shot-frame {
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(31, 29, 61, 0.08), 0 28px 60px -22px rgba(31, 29, 61, 0.55);
}
.hhm-float .shot-chrome { height: 18px; padding: 0 9px; gap: 5px; }
.hhm-float .shot-chrome i { width: 6px; height: 6px; }
.hhm-float--a { right: -5%; bottom: 0; width: 50%; }
.hhm-float--b { left: -6%; bottom: 5%; width: 40%; z-index: 3; }

/* ------------------------------------------------------------------ label */
.hhm-label {
  display: block;
  margin: 18px 0 0;
  color: var(--muted, #64645f);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}
.hhm-label::before { display: inline-block; width: 7px; height: 7px; margin-right: 9px; vertical-align: 1px; content: ""; border-radius: 50%; background: var(--green, #188848); }

/* ------------------------------------------------------ video (when set) */
.hhm-play {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 14, 34, 0) 40%, rgba(15, 14, 34, 0.42) 100%);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.hhm-play-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 10px;
  border-radius: 999px;
  background: rgba(15, 14, 34, 0.78);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.01em;
  transition: transform 220ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), background-color 220ms ease;
}
.hhm-play-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--coral, #ff6f61);
}
.hhm-play-icon::before {
  width: 0;
  height: 0;
  margin-left: 4px;
  content: "";
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #fff;
}
.hhm-play-time { color: rgba(255, 255, 255, 0.7); font-family: "Geist Mono", monospace; font-size: 12px; font-weight: 560; }
.hhm-play:hover .hhm-play-badge { background: rgba(15, 14, 34, 0.9); transform: scale(1.03); }
.hhm-play:active .hhm-play-badge { transform: scale(0.98); }
.hhm-play:focus-visible { outline: 3px solid var(--explore-lilac-border, #6f4bd8); outline-offset: 4px; }

.hhm-player {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  border-radius: 20px;
  background: #000;
  box-shadow: 0 40px 90px -34px rgba(31, 29, 61, 0.5);
}
.hhm-player iframe,
.hhm-player video { display: block; width: 100%; height: 100%; border: 0; }

/* While the video plays, the floating windows step aside. */
.home-hero-media.is-playing .hhm-stage { padding-bottom: 0; }
.home-hero-media.is-playing .hhm-float,
.home-hero-media.is-playing .hhm-label { display: none; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1120px) {
  .home-hero-media { max-width: 560px; }
}
@media (max-width: 900px) {
  .suite-hero-grid > .home-hero-media { width: min(100%, 720px); max-width: 720px; margin: 8px auto 0; justify-self: center; }
  .hhm-float--a { right: -2%; }
  .hhm-float--b { left: -2%; }
}
@media (max-width: 620px) {
  .hhm-stage { padding-bottom: 17%; }
  .hhm-stage::before { inset: 10% -2% 2% 4%; border-radius: 20px; transform: none; }
  .hhm-screen, .hhm-screen > .shot .shot-frame, .hhm-play, .hhm-player { border-radius: 14px; }
  .hhm-float--a { right: 0; width: 54%; }
  .hhm-float--b { left: 0; bottom: 4%; width: 44%; }
  .hhm-float .shot-frame { border-radius: 10px; }
  .hhm-float .shot-chrome { height: 12px; padding: 0 6px; gap: 3px; }
  .hhm-float .shot-chrome i { width: 4px; height: 4px; }
  .hhm-label { font-size: 10px; letter-spacing: 0.1em; }
  .hhm-play-badge { gap: 10px; padding: 8px 16px 8px 8px; font-size: 14px; }
  .hhm-play-icon { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .hhm-play-badge { transition: none; }
  .hhm-play:hover .hhm-play-badge, .hhm-play:active .hhm-play-badge { transform: none; }
}
