<!DOCTYPE html>

<html lang="ru">

<head>

  <meta charset="utf-8" />

  <meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="robots" content="noindex,nofollow" />

  <title>Открою во внешнем браузере…</title>

  <style>

    *{box-sizing:border-box} body{margin:0;background:#fff;color:#111;

      font:16px/1.5 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Arial,sans-serif}

    .wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}

    .card{max-width:640px;width:100%;border:1px solid #e5e7eb;border-radius:16px;padding:22px;text-align:center}

    h1{margin:0 0 8px;font-size:22px} p{margin:0 0 16px}

    .btn{display:inline-block;margin:6px 6px 0 6px;padding:12px 16px;border-radius:12px;

      text-decoration:none;border:1px solid #2563eb;background:#2563eb;color:#fff;font-weight:600}

    .btn.secondary{background:#f3f4f6;color:#111;border-color:#d1d5db}

    .hint{font-size:13px;color:#555;margin-top:10px}

    .spin{width:20px;height:20px;border:3px solid #dbeafe;border-top-color:#2563eb;border-radius:50%;

      margin:0 auto 10px;animation:r 1s linear infinite}@keyframes r{to{transform:rotate(360deg)}}

  </style>

  <script>

    const TARGET = "https://beacons.ai/kateleksa";

    const ua = navigator.userAgent;

    const isIG = /Instagram|FBAN|FBAV|FB_IAB/i.test(ua);

    const isAndroid = /Android/i.test(ua);

    const isIOS = /iPhone|iPad|iPod/i.test(ua);


    function kickAndroid(){

      // Пытаемся открыть Chrome (дефолт) через intent://

      location.href = "intent://" + TARGET.replace(/^https?:\/\//,'')

                    + "#Intent;scheme=https;package=com.android.chrome;end";

      // Если IG заблокировал — через 1.2с просто откроем HTTPS (всё равно полезно)

      setTimeout(()=>{ location.href = TARGET; }, 1200);

    }

    function kickIOS(){

      // Пробуем открыть новую вкладку (часто показывает «Open in Safari»)

      window.open(TARGET, "_blank", "noopener");

      // На всякий случай продублируем переход в текущей вкладке

      setTimeout(()=>{ location.href = TARGET; }, 1200);

    }

    function autoKick(){

      try{

        if(isIG){

          if(isAndroid) kickAndroid();

          else if(isIOS) kickIOS();

          else location.href = TARGET;

        }else{

          // Вне Instagram — обычный переход

          location.replace(TARGET);

        }

      }catch(e){ location.href = TARGET; }

    }

    // Дадим IG-иабу инициализироваться, затем попробуем «вытолкнуть»

    window.addEventListener('load', ()=> setTimeout(autoKick, 600));

  </script>

</head>

<body>

  <div class="wrap">

    <div class="card">

      <div class="spin"></div>

      <h1>Открываю во внешнем браузере…</h1>

      <p>Если страница не сменилась автоматически, нажми одну из кнопок ниже.</p>


      <!-- Кнопки-подстраховки -->

      <a class="btn" href="https://beacons.ai/kateleksa" target="_blank" rel="noopener">Открыть в браузере</a>

      <a class="btn secondary" href="intent://beacons.ai/kateleksa#Intent;scheme=https;package=com.android.chrome;end">Открыть в Chrome</a>


      <div class="hint">

        В Instagram можно также нажать <b>⋯</b> (справа сверху) → <b>Open in system browser</b>.

      </div>


      <noscript>

        <p>JavaScript отключён. Перейди по ссылке: <a href="https://beacons.ai/kateleksa">https://beacons.ai/kateleksa</a></p>

      </noscript>

    </div>

  </div>

</body>

</html>