.elementor-kit-5{--e-global-color-primary:#35538B;--e-global-color-secondary:#3974A0;--e-global-color-text:#0D0D0D;--e-global-color-accent:#3974A0;--e-global-color-4f6cddc:#FAFAFA;--e-global-color-17ac88c:#FFFFFF;--e-global-color-8199f19:#E8F0F8;--e-global-color-b9d508d:#6B7280;--e-global-color-57d4fbc:#E2E8F0;--e-global-color-f4a8366:#0D0D0D;--e-global-color-0ad5733:#1A1A2E;--e-global-color-785960f:#111827;--e-global-typography-primary-font-family:"Baskervville";--e-global-typography-primary-font-weight:900;--e-global-typography-secondary-font-family:"Space Grotesk";--e-global-typography-secondary-font-weight:700;--e-global-typography-text-font-family:"Inter";--e-global-typography-text-font-weight:400;--e-global-typography-accent-font-family:"Space Mono";--e-global-typography-accent-font-weight:400;font-family:"Inter", serif;font-size:16px;font-weight:400;line-height:1.75px;background-color:#0D0D0D;}.elementor-kit-5 a{color:#3974A0;}.elementor-kit-5 h1{font-family:"Baskervville", serif;font-size:64px;font-weight:500;line-height:1.05em;letter-spacing:0.03em;}.elementor-kit-5 h2{font-family:"Space Grotesk", serif;font-size:36px;font-weight:700;line-height:1.2em;letter-spacing:0.02px;}.elementor-kit-5 h3{font-family:"Space Grotesk", serif;font-size:24px;font-weight:700;letter-spacing:0.01em;}.elementor-kit-5 h4{font-family:"Space Grotesk", serif;font-size:18px;font-weight:700;line-height:1.4em;}.elementor-kit-5 button,.elementor-kit-5 input[type="button"],.elementor-kit-5 input[type="submit"],.elementor-kit-5 .elementor-button{font-family:"Space Grotesk", serif;font-size:14px;font-weight:700;color:#35538B;background-color:#FFFFFF;border-style:solid;border-width:3px 3px 3px 3px;border-color:#FFFFFF;border-radius:5px 5px 5px 5px;padding:12px 26px 12px 26px;}.elementor-section.elementor-section-boxed > .elementor-container{max-width:1180px;}.e-con{--container-max-width:1180px;}.elementor-widget:not(:last-child){--kit-widget-spacing:20px;}.elementor-element{--widgets-spacing:20px 20px;--widgets-spacing-row:20px;--widgets-spacing-column:20px;}{}h1.entry-title{display:var(--page-title-display);}.elementor-kit-5 e-page-transition{background-color:#FFBC7D;}.site-header .site-branding{flex-direction:column;align-items:stretch;}.site-header{padding-inline-end:0px;padding-inline-start:0px;}.site-footer .site-branding{flex-direction:column;align-items:stretch;}@media(max-width:1024px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:1024px;}.e-con{--container-max-width:1024px;}}@media(max-width:767px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:767px;}.e-con{--container-max-width:767px;}}/* Start custom CSS */<!-- ============================================================
     CURLEY CORE LLC — Signal Decay Transition Controller
     Version: 1.0
     Paste into an Elementor HTML widget placed BETWEEN the
     hero section and the services section.
     Desktop only (≥1025px). Mobile preserves standard scroll reveal.
     ============================================================ -->

<script>
(function() {

  // Only run on desktop
  if (window.innerWidth < 1025) return;

  var EASING_OUT = 'cubic-bezier(0.76, 0, 0.24, 1)';
  var EASING_IN  = 'cubic-bezier(0.16, 1, 0.3, 1)';

  // ── STATE ──────────────────────────────────────────────────
  var heroDecayed   = false;
  var servicesReady = false;

  // ── GLITCH KEYFRAMES ───────────────────────────────────────
  var style = document.createElement('style');
  style.textContent = `
    @keyframes cc-glitch-out {
      0%   { transform: translateX(0)     skewX(0deg);  opacity: 1; }
      15%  { transform: translateX(-6px)  skewX(-2deg); opacity: 0.9; }
      30%  { transform: translateX(4px)   skewX(1deg);  opacity: 0.7; }
      45%  { transform: translateX(-8px)  skewX(-3deg); opacity: 0.5; }
      60%  { transform: translateX(3px)   skewX(1deg);  opacity: 0.3; }
      75%  { transform: translateX(-4px)  skewX(-1deg); opacity: 0.15; }
      100% { transform: translateX(20px)  skewX(0deg);  opacity: 0; }
    }

    @keyframes cc-scanline-wipe {
      0%   { clip-path: inset(0 0 100% 0); opacity: 1; }
      100% { clip-path: inset(0 0 0% 0);   opacity: 1; }
    }

    @keyframes cc-transmit-in {
      0%   { opacity: 0; transform: translateY(10px); filter: blur(2px); }
      60%  { opacity: 0.8; }
      100% { opacity: 1; transform: translateY(0); filter: blur(0); }
    }

    @keyframes cc-frame-shrink {
      0%   { transform: scale(1);    opacity: 1; clip-path: polygon(0% 0%, calc(100% - 40px) 0%, 100% 40px, 100% 100%, 40px 100%, 0% calc(100% - 40px)); }
      40%  { transform: scale(0.85); opacity: 0.6; clip-path: polygon(0% 0%, calc(100% - 40px) 0%, 100% 40px, 100% 100%, 40px 100%, 0% calc(100% - 40px)); }
      100% { transform: scale(0.1);  opacity: 0; clip-path: polygon(40% 40%, 60% 40%, 60% 60%, 60% 60%, 40% 60%, 40% 60%); }
    }

    @keyframes cc-cursor-blink-fast {
      0%,100% { opacity: 0; }
      50%     { opacity: 1; }
    }

    /* Scanline effect on transmitting elements */
    .cc-transmitting::after {
      content: '';
      position: absolute;
      left: 0; right: 0;
      height: 2px;
      background: rgba(57,116,160,0.6);
      animation: cc-scan-line 1.2s ease-out forwards;
      pointer-events: none;
    }
    @keyframes cc-scan-line {
      0%   { top: 0%; opacity: 1; }
      100% { top: 100%; opacity: 0; }
    }

    /* Decay applied state */
    .cc-decayed {
      opacity: 0 !important;
      pointer-events: none !important;
    }

    /* Transmitted state */
    .cc-transmitted {
      opacity: 1 !important;
      transform: translateY(0) !important;
      filter: blur(0) !important;
    }
  `;
  document.head.appendChild(style);

  // ── HERO DECAY ─────────────────────────────────────────────
  function decayHero() {
    if (heroDecayed) return;
    heroDecayed = true;

    var eyebrow = document.querySelector('#hero .cc-eyebrow-text');
    var h1      = document.querySelector('#hero .cc-hero-h1');
    var sub     = document.querySelector('#hero .cc-anim-sub');
    var btns    = document.querySelector('#hero .cc-anim-btns');
    var frame   = document.querySelector('#hero .cc-anim-right');
    var metaItems = document.querySelectorAll('#hero .cc-hero-right [style*="flex:1"]');

    var elements = [eyebrow, h1, sub, btns].filter(Boolean);
    var delays   = [0, 60, 120, 180];

    // Glitch out text elements
    elements.forEach(function(el, i) {
      setTimeout(function() {
        el.style.animation = 'cc-glitch-out 0.55s ' + EASING_OUT + ' forwards';
      }, delays[i]);
    });

    // Shrink frame
    if (frame) {
      setTimeout(function() {
        var img = frame.querySelector('div[style*="clip-path"]') || frame.querySelector('div');
        if (img) {
          img.style.transition = 'none';
          img.style.animation = 'cc-frame-shrink 0.7s ' + EASING_OUT + ' forwards';
        }
        // Meta strip fades
        frame.querySelectorAll('[style*="flex:1;padding"]').forEach(function(item) {
          item.style.transition = 'opacity 0.4s ease-out';
          item.style.opacity = '0';
        });
      }, 80);
    }

    // Trigger services transmit after decay starts
    setTimeout(transmitServices, 300);
  }

  function resetHero() {
    if (!heroDecayed) return;
    heroDecayed = false;

    var elements = [
      document.querySelector('#hero .cc-eyebrow-text'),
      document.querySelector('#hero .cc-hero-h1'),
      document.querySelector('#hero .cc-anim-sub'),
      document.querySelector('#hero .cc-anim-btns'),
    ].filter(Boolean);

    elements.forEach(function(el) {
      el.style.animation = '';
      el.style.opacity = '1';
      el.style.transform = '';
    });

    var frame = document.querySelector('#hero .cc-anim-right');
    if (frame) {
      var img = frame.querySelector('div[style*="clip-path"]') || frame.querySelector('div');
      if (img) {
        img.style.animation = '';
        img.style.transform = '';
        img.style.opacity = '1';
      }
      frame.querySelectorAll('[style*="flex:1;padding"]').forEach(function(item) {
        item.style.opacity = '1';
      });
    }
  }

  // ── SERVICES TRANSMIT ──────────────────────────────────────
  function transmitServices() {
    var cards = document.querySelectorAll('#services .cc-services-card');
    var h2    = document.querySelector('#services h2');
    var sub   = document.querySelector('#services p');

    if (h2) {
      h2.style.animation = 'cc-scanline-wipe 0.5s ease-out forwards';
      h2.style.clipPath = 'inset(0 0 100% 0)';
    }
    if (sub) {
      setTimeout(function() {
        sub.style.animation = 'cc-transmit-in 0.5s ease-out forwards';
        sub.style.opacity = '0';
      }, 150);
    }
    cards.forEach(function(card, i) {
      setTimeout(function() {
        card.style.animation = 'cc-transmit-in 0.5s ' + EASING_IN + ' forwards';
        card.style.opacity = '0';
        card.classList.add('cc-revealed');
      }, 200 + (i * 100));
    });
  }

  function resetServices() {
    var cards = document.querySelectorAll('#services .cc-services-card');
    var h2    = document.querySelector('#services h2');
    var sub   = document.querySelector('#services p');

    if (h2) { h2.style.animation = ''; h2.style.clipPath = ''; }
    if (sub) { sub.style.animation = ''; sub.style.opacity = ''; }
    cards.forEach(function(card) {
      card.style.animation = '';
      card.style.opacity = '';
      card.classList.remove('cc-revealed');
    });
  }

  // ── INTERSECTION OBSERVER ──────────────────────────────────
  // Fires when 40% of hero has left the viewport (60% visible threshold)
  var heroObserver = new IntersectionObserver(function(entries) {
    entries.forEach(function(entry) {
      if (!entry.isIntersecting && entry.boundingClientRect.top < 0) {
        // Hero is scrolling out the top — 40% gone
        decayHero();
      } else if (entry.isIntersecting && entry.intersectionRatio > 0.6) {
        // Hero is back — reset
        resetHero();
        resetServices();
      }
    });
  }, {
    threshold: [0.6] // fires when hero drops below 60% visible = 40% off screen
  });

  // Wait for DOM ready then observe
  function init() {
    var hero = document.getElementById('hero');
    if (hero) {
      heroObserver.observe(hero);
    } else {
      // Retry if hero not yet in DOM
      setTimeout(init, 200);
    }
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', init);
  } else {
    setTimeout(init, 100);
  }

})();
</script>/* End custom CSS */