/* Kazhan Advertising website. Designed and built by Ahmed Salam Rasool, 2026. */
/* =====================================================================
   Header motion. The header looks exactly the same as before; it only moves.
   1. Opening: a laser line runs along the bottom edge of the header, the
      logo switches on like an LED sign, the menu drops in item by item,
      and the WhatsApp icons ring once.
   2. A light bar slides under the menu to the item the mouse is on.
   3. Services and Products unfold, and their items come in one by one.
   4. A soft glint crosses the Contact button every few seconds.
   5. Scrolling down: the header gets slimmer and turns to frosted glass.
   6. Phones: the menu slides open and its items come in one by one.
   7. The day/night button spins as the new look spreads from it.
   header-fx.js adds the light bar and the slim header. Visitors whose
   device asks for less motion get none of this, and nothing moves while
   a page is being edited.
   At the end: a fix for the phone menu, which opened as a narrow strip.
   ===================================================================== */
@media (prefers-reduced-motion: no-preference){

  /* ---- 1. Opening ---- */
  /* the laser: a bright point runs along the bottom edge, its cut glows and then fades.
     Its colour is the website's own: the mint of the lit KAZHAN sign, with the brand green in its trail. */
  header{--hfx-laser:143 224 184;--hfx-trail:81 121 112;--hfx-core:#F2FFF8;}
  /* by day the laser is darker: the brand green, with a navy trail */
  html:not(.night) header{--hfx-laser:63 95 87;--hfx-trail:47 62 70;--hfx-core:#2F4F47;}
  header::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;z-index:3;pointer-events:none;
    background:linear-gradient(90deg,rgb(var(--hfx-trail) / 0) 0%,rgb(var(--hfx-trail) / .7) 45%,rgb(var(--hfx-laser)) 86%,var(--hfx-core) 100%);
    box-shadow:0 0 10px rgb(var(--hfx-laser) / .6);
    transform:scaleX(0);transform-origin:0 50%;opacity:0;
    animation:hfxCut 1.2s cubic-bezier(.5,.05,.3,1) .1s both;}
  header::before{content:"";position:absolute;left:-4px;bottom:-4px;width:8px;height:8px;border-radius:50%;z-index:4;pointer-events:none;
    background:var(--hfx-core);box-shadow:0 0 6px 2px rgb(var(--hfx-laser) / .95),0 0 18px 6px rgb(var(--hfx-laser) / .5);
    opacity:0;animation:hfxHead 1.2s cubic-bezier(.5,.05,.3,1) .1s both;}

  /* the logo switches on like a sign: a few flickers, and at night a short glow */
  .navbar2 .nav-logo{--hfx-glow:rgba(143,224,184,0);animation:hfxLedOn 1s linear .3s backwards;}
  html.night .navbar2 .nav-logo{--hfx-glow:rgba(143,224,184,.85);}
  @media (hover:hover){
    .navbar2 .nav-logo:hover img{animation:hfxBuzz .5s linear;}
  }

  /* the menu and the buttons come in one after another */
  .navbar2 .nav-right > *,.navbar2 .mobile-toggle{animation:hfxPop .55s cubic-bezier(.2,.8,.25,1.25) backwards;}
  .navbar2 .nav-right > :nth-child(1){animation-delay:.85s;}
  .navbar2 .nav-right > :nth-child(2){animation-delay:.95s;}
  .navbar2 .nav-right > :nth-child(3){animation-delay:1.05s;}
  .navbar2 .mobile-toggle{animation-delay:1.05s;}

  /* the contact line above the header fades in, and the WhatsApp icons ring once */
  .topbar .t-item{animation:hfxFade .6s ease backwards;}
  .topbar .t-item:nth-child(2){animation-delay:.1s;}
  .topbar .t-item:nth-child(3){animation-delay:.2s;}
  .topbar a[href*="wa.me"] .icon-circle img{transform-origin:50% 60%;animation:hfxRing 1s ease 1.4s backwards;}
  .topbar a[href*="wa.me"] + a[href*="wa.me"] .icon-circle img{animation-delay:1.7s;}

  @media (min-width:981px){
    .navbar2 nav > ul > li{animation:hfxDrop .6s cubic-bezier(.2,.8,.2,1) backwards;}
    .navbar2 nav > ul > li:nth-child(1){animation-delay:.45s;}
    .navbar2 nav > ul > li:nth-child(2){animation-delay:.52s;}
    .navbar2 nav > ul > li:nth-child(3){animation-delay:.59s;}
    .navbar2 nav > ul > li:nth-child(4){animation-delay:.66s;}
    .navbar2 nav > ul > li:nth-child(5){animation-delay:.73s;}
    .navbar2 nav > ul > li:nth-child(6){animation-delay:.8s;}
    .navbar2 nav > ul > li:nth-child(n+7){animation-delay:.87s;}

    /* ---- 2. The light bar under the menu (header-fx.js places it) ---- */
    html.kz-hfx-bar .navbar2 nav{position:relative;}
    .hfx-bar{position:absolute;left:0;top:0;width:0;height:3px;border-radius:3px;background:var(--brass);pointer-events:none;opacity:0;
      transition:transform .5s cubic-bezier(.3,.85,.25,1),width .5s cubic-bezier(.3,.85,.25,1),opacity .3s ease;}
    .hfx-bar.on{opacity:1;}
    html.night .hfx-bar{box-shadow:0 0 12px rgba(143,224,184,.5),0 0 2px rgba(143,224,184,.8);}
    /* the bar takes over from the fixed line under the current page and the old hover line */
    html.kz-hfx-bar:not(.kz-editing) .navbar2 nav > ul > li > a.active{border-bottom-color:transparent;}
    html.kz-hfx-bar:not(.kz-editing) .navbar2 nav > ul > li > a:not(.active){background-image:none;}

    /* ---- 3. Services and Products unfold, their items one by one ---- */
    .navbar2 nav ul li.has-dropdown .dropdown-menu{animation:hfxUnfold .4s cubic-bezier(.2,.8,.2,1) backwards;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li{animation:hfxItem .42s cubic-bezier(.2,.8,.2,1) backwards;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(2){animation-delay:.035s;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(3){animation-delay:.07s;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(4){animation-delay:.105s;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(5){animation-delay:.14s;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(6){animation-delay:.175s;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(7){animation-delay:.21s;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(8){animation-delay:.245s;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(9){animation-delay:.28s;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu > li:nth-child(n+10){animation-delay:.315s;}
    /* the item under the mouse steps a little to the right (the menu keeps its width) */
    .navbar2 nav ul li.has-dropdown .dropdown-menu li a{transition:background .15s ease,padding .25s ease;}
    .navbar2 nav ul li.has-dropdown .dropdown-menu li a:hover{padding-left:26px;padding-right:14px;}
  }
  .navbar2 nav ul li.has-dropdown > a .caret{transition:transform .4s cubic-bezier(.3,1.6,.5,1);}
  .hfx-bar{display:none;}
  @media (min-width:981px){ .hfx-bar{display:block;} }
  html.kz-editing .hfx-bar{display:none;}

  /* ---- 4. A glint crosses the Contact button every few seconds ---- */
  .navbar2 .nav-right a.cta{position:relative;overflow:hidden;transition:background-color .2s ease,transform .25s ease,box-shadow .25s ease;}
  .navbar2 .nav-right a.cta::after{content:"";position:absolute;top:0;bottom:0;left:0;width:60%;pointer-events:none;
    background:linear-gradient(105deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.42) 50%,rgba(255,255,255,0) 100%);
    transform:translateX(-120%) skewX(-14deg);animation:hfxGlint 6.5s ease-in-out 2.2s infinite;}
  @media (hover:hover){
    .navbar2 .nav-right a.cta:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(20,32,30,.28);}
  }

  /* ---- 5. Slimmer, frosted header once the visitor scrolls down (header-fx.js) ---- */
  html.kz-hfx .navbar2{transition:padding .4s cubic-bezier(.3,.8,.25,1);}
  html.kz-hfx .navbar2 .nav-logo img{transition:height .4s cubic-bezier(.3,.8,.25,1);}
  html.kz-hfx header{transition:background-color .4s ease,box-shadow .3s ease;}
  html.kz-hfx-slim .navbar2{padding-top:7px;padding-bottom:7px;}
  html.kz-hfx-slim .navbar2 .nav-logo img{height:29px;}
  html.kz-hfx-slim header{background-color:rgba(238,249,232,.84);-webkit-backdrop-filter:blur(14px) saturate(1.4);backdrop-filter:blur(14px) saturate(1.4);}
  html.night.kz-hfx-slim header{background-color:rgba(21,33,31,.84);}

  /* ---- 6. Phones: the menu slides open and its items come in one by one ---- */
  @media (max-width:980px){
    .navbar2 nav.mobile-open{animation:hfxPanel .42s cubic-bezier(.2,.8,.2,1) backwards;}
    .navbar2 nav.mobile-open > ul > li{animation:hfxItem .45s cubic-bezier(.2,.8,.2,1) backwards;}
    .navbar2 nav.mobile-open > ul > li:nth-child(1){animation-delay:.06s;}
    .navbar2 nav.mobile-open > ul > li:nth-child(2){animation-delay:.11s;}
    .navbar2 nav.mobile-open > ul > li:nth-child(3){animation-delay:.16s;}
    .navbar2 nav.mobile-open > ul > li:nth-child(4){animation-delay:.21s;}
    .navbar2 nav.mobile-open > ul > li:nth-child(5){animation-delay:.26s;}
    .navbar2 nav.mobile-open > ul > li:nth-child(n+6){animation-delay:.31s;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li{animation:hfxItem .4s cubic-bezier(.2,.8,.2,1) backwards;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li:nth-child(2){animation-delay:.03s;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li:nth-child(3){animation-delay:.06s;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li:nth-child(4){animation-delay:.09s;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li:nth-child(5){animation-delay:.12s;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li:nth-child(6){animation-delay:.15s;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li:nth-child(7){animation-delay:.18s;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li:nth-child(8){animation-delay:.21s;}
    .navbar2 nav ul li.has-dropdown.mobile-expanded .dropdown-menu > li:nth-child(n+9){animation-delay:.24s;}
    .mobile-toggle span{transition:transform .35s cubic-bezier(.3,1.4,.5,1),opacity .2s ease;}
  }

  /* ---- 7. The day/night button spins when pressed (header-fx.js) ---- */
  .mode-btn.hfx-spin svg{animation:hfxSpin .7s cubic-bezier(.3,1.3,.5,1);}

  /* nothing replays or moves around while a page is being edited */
  html.kz-editing header::before,html.kz-editing header::after,
  html.kz-editing .navbar2 .nav-right a.cta::after{display:none;}
}

/* ---- Phone menu fix (not motion) ----
   The phone menu was placed in the middle column of the header, so it opened as a
   narrow strip and ran off the right edge of the screen when Services was opened.
   It now opens across the whole width under the header, as its own styles intend. */
@media (max-width:980px){
  .navbar2 nav{grid-column:auto;justify-self:stretch;}
}

@keyframes hfxCut{0%{transform:scaleX(0);opacity:1;}72%{transform:scaleX(1);opacity:1;}100%{transform:scaleX(1);opacity:0;}}
@keyframes hfxHead{0%{transform:translateX(0);opacity:1;}72%{transform:translateX(100vw);opacity:1;}100%{transform:translateX(100vw);opacity:0;}}
/* at night the glow colour is mint, by day it is see-through (so there is no glow) */
@keyframes hfxLedOn{
  0%{opacity:0;filter:drop-shadow(0 0 0 rgba(143,224,184,0));}
  7%{opacity:.9;filter:drop-shadow(0 0 7px var(--hfx-glow));}
  13%{opacity:.1;}
  22%{opacity:1;filter:drop-shadow(0 0 9px var(--hfx-glow));}
  30%{opacity:.3;}
  44%{opacity:1;filter:drop-shadow(0 0 10px var(--hfx-glow));}
  52%{opacity:.7;}
  60%{opacity:1;filter:drop-shadow(0 0 8px var(--hfx-glow));}
  100%{opacity:1;filter:drop-shadow(0 0 0 rgba(143,224,184,0));}}
@keyframes hfxBuzz{0%,100%{opacity:1;}18%{opacity:.25;}32%{opacity:1;}50%{opacity:.45;}66%{opacity:1;}}
@keyframes hfxDrop{from{opacity:0;transform:translateY(-12px);}to{opacity:1;transform:none;}}
@keyframes hfxPop{from{opacity:0;transform:scale(.8);}to{opacity:1;transform:none;}}
@keyframes hfxFade{from{opacity:0;transform:translateY(-6px);}to{opacity:1;transform:none;}}
@keyframes hfxRing{0%,100%{transform:none;}12%{transform:rotate(-16deg);}24%{transform:rotate(14deg);}36%{transform:rotate(-12deg);}48%{transform:rotate(9deg);}60%{transform:rotate(-5deg);}72%{transform:rotate(2deg);}}
@keyframes hfxUnfold{from{clip-path:inset(0 0 100% 0);opacity:.5;}to{clip-path:inset(0 0 0 0);opacity:1;}}
@keyframes hfxItem{from{opacity:0;transform:translateX(-14px);}to{opacity:1;transform:none;}}
@keyframes hfxPanel{from{clip-path:inset(0 0 100% 0);}to{clip-path:inset(0 0 0 0);}}
@keyframes hfxGlint{0%{transform:translateX(-120%) skewX(-14deg);}16%,100%{transform:translateX(260%) skewX(-14deg);}}
@keyframes hfxSpin{from{transform:rotate(-200deg) scale(.6);}to{transform:none;}}
