<!doctype html>
<html <?php echo get_language_attributes(); ?>>
<?php echo $__env->make('partials.head', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<body <?php body_class('new') ?>><?php wp_body_open(); ?>
  <div class="body-wrap">

    <?php if (is_home() || is_front_page()) : ?>
    <div class="loader is-active">
      <div class="ball-scale-multiple">
        <div></div>
      </div>
    </div>
    <?php endif; ?>

    <?php do_action('get_header') ?>
    <?php echo $__env->make('partials.header-new', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

    <div class="wrap container" role="document">
      <div class="content">
        <main class="main">
          <?php echo $__env->yieldContent('content'); ?>
        </main>
      </div>
    </div>
    <?php do_action('get_footer') ?>
    <?php echo $__env->make('partials.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php wp_footer() ?>

  </div>

  <script>
    <?php if (is_home() || is_front_page()) : ?>
    window.addEventListener('load', menuForCurrent);

    function menuForCurrent() {
      if (!window.ScrollTrigger) return;

      const baseOffset = 100;
      const createHighlight = (menuEl, trigger, extraOffset = 0) => {
        if (!menuEl || !document.querySelector(trigger)) return;
        const offset = baseOffset + extraOffset;
        ScrollTrigger.create({
          trigger,
          start: `top top+=${offset}`,
          end: `bottom top+=${offset}`,
          onEnter: () => menuEl.classList.add('current'),
          onEnterBack: () => menuEl.classList.add('current'),
          onLeave: () => menuEl.classList.remove('current'),
          onLeaveBack: () => menuEl.classList.remove('current'),
        });
      };

      const top = document.querySelector('.menu-item-top')
      const news = document.querySelector('.menu-item-news')
      const works = document.querySelector('.menu-item-works')
      const message = document.querySelector('.menu-item-message')
      const contact = document.querySelector('.menu-item-contact')

      createHighlight(top, '#hero')
      createHighlight(news, '#news', 20)
      createHighlight(works, '#works')
      createHighlight(message, '#message')
      createHighlight(contact, '#contact-form')

    }
    <?php endif; ?>
  </script>
</body>

</html>
