/* effects.css — รวม 2 หน้า
   ส่วน INDEX: ทุก selector ขึ้นต้นด้วย html:not(.fx-about)  (เนื้อหาเดิมของ index ไม่เปลี่ยน แค่ครอบไว้ไม่ให้ไปโดนหน้า about)
   ส่วน ABOUT: ทุก selector ขึ้นต้นด้วย html.fx-about หรือเป็น class เฉพาะ (fx-p/fx-go/...)
   effects.js จะใส่ class fx-about ให้ <html> เองเมื่ออยู่หน้า about */

/* ======================= INDEX ======================= */
html:not(.fx-about) #fx-bar{position:fixed;top:0;left:0;height:3px;width:100%;background:linear-gradient(90deg,#FFD90D,#FFA200);transform-origin:0 50%;transform:scaleX(0);z-index:99999;pointer-events:none}
html:not(.fx-about) .fx{opacity:0;translate:0 56px;scale:.97;transition:opacity 1s cubic-bezier(.16,1,.3,1) var(--d,0s),translate 1.1s cubic-bezier(.16,1,.3,1) var(--d,0s),scale 1.1s cubic-bezier(.16,1,.3,1) var(--d,0s),clip-path 1.2s cubic-bezier(.7,0,.2,1) var(--d,0s)!important}
html:not(.fx-about) .fx.in{opacity:1;translate:0 0;scale:1}
html:not(.fx-about) .item.fx{clip-path:inset(12% round 22px)}
html:not(.fx-about) .item.fx.in{clip-path:inset(0 round 0)}
html:not(.fx-about) .fx-l{clip-path:inset(-4px 100% -4px 0);transition:clip-path 1.2s cubic-bezier(.7,0,.2,1) .25s}
html:not(.fx-about) .fx-l.in{clip-path:inset(-4px)}
html:not(.fx-about) .slide.active img{animation:fxkb 9s ease-out both}
@keyframes fxkb{from{scale:1}to{scale:1.025}}
html:not(.fx-about) .frame path{stroke-dasharray:1;stroke-dashoffset:1}
html:not(.fx-about) .frame.in path{animation:fxdp 2.2s cubic-bezier(.6,0,.2,1) forwards}
@keyframes fxdp{to{stroke-dashoffset:0}}
html:not(.fx-about) .arrow2 polyline{animation:fxar 1.8s ease-in-out infinite}
html:not(.fx-about) .arrow2 polyline:nth-child(2){animation-delay:.15s}
html:not(.fx-about) .arrow2 polyline:nth-child(3){animation-delay:.3s}
html:not(.fx-about) .arrow2 polyline:nth-child(4){animation-delay:.45s}
html:not(.fx-about) .arrow2 polyline:nth-child(5){animation-delay:.6s}
@keyframes fxar{0%,100%{opacity:.2}50%{opacity:1}}
html:not(.fx-about) .construction-card,html:not(.fx-about) .whychoose-item{will-change:transform}
html:not(.fx-about) #fx-cur{position:fixed;left:0;top:0;width:34px;height:34px;margin:-17px 0 0 -17px;border:1.5px solid #FFD90D;border-radius:50%;pointer-events:none;z-index:99998;transition:width .3s,height .3s,margin .3s,background .3s,opacity .3s;opacity:0}
html:not(.fx-about) #fx-cur.on{opacity:1}
html:not(.fx-about) #fx-cur.h{width:68px;height:68px;margin:-34px 0 0 -34px;background:rgba(255,217,13,.16)}
@media(pointer:coarse){html:not(.fx-about) #fx-cur{display:none}}
@media(prefers-reduced-motion:reduce){html:not(.fx-about) .fx,html:not(.fx-about) .fx-l{opacity:1!important;translate:none!important;scale:none!important;clip-path:none!important}html:not(.fx-about) .slide.active img,html:not(.fx-about) .arrow2 polyline{animation:none}}
html:not(.fx-about) .frame.done path{stroke-dasharray:none;stroke-dashoffset:0;animation:none}
html:not(.fx-about) .main-header{animation:fxhd 1s cubic-bezier(.16,1,.3,1) backwards}
@keyframes fxhd{from{translate:0 -100%;opacity:0}}
html:not(.fx-about) .box-banner{animation:fxfi 1.4s ease backwards}
@keyframes fxfi{from{opacity:0}}
html:not(.fx-about) .fx-t{opacity:0;translate:0 34px;filter:blur(10px);transition:opacity .9s cubic-bezier(.16,1,.3,1) var(--d,0s),translate .9s cubic-bezier(.16,1,.3,1) var(--d,0s),filter .9s ease var(--d,0s)!important}
html:not(.fx-about) .fx-t.in{opacity:1;translate:0 0;filter:blur(0)}
html:not(.fx-about) .service-item img{transition:translate .5s cubic-bezier(.16,1,.3,1),scale .5s cubic-bezier(.16,1,.3,1),box-shadow .5s}
html:not(.fx-about) .service-item:hover img{translate:0 -10px;scale:1.07;box-shadow:0 18px 30px rgba(245,184,0,.35)}
html:not(.fx-about) .construction-icon img,html:not(.fx-about) .whychoose-icon img{transition:scale .5s cubic-bezier(.16,1,.3,1)}
html:not(.fx-about) .construction-card:hover .construction-icon img,html:not(.fx-about) .whychoose-item:hover .whychoose-icon img{scale:1.08}
html:not(.fx-about) .construction-card.gl{background-image:radial-gradient(300px circle at var(--mx,50%) var(--my,50%),rgba(255,217,13,.24),transparent 65%)}
html:not(.fx-about) .whychoose-item.gl{background-image:radial-gradient(300px circle at var(--mx,50%) var(--my,50%),rgba(255,217,13,.16),transparent 65%)}
html:not(.fx-about) .item img{transition:transform .4s ease,translate .3s ease-out}
html:not(.fx-about) .circle-badge{animation:fxbr 2.6s ease-in-out infinite}
@keyframes fxbr{50%{scale:1.1}}
html:not(.fx-about) .Left-Image.fl,html:not(.fx-about) .Right-Image.fl{animation:fxfl 6s ease-in-out infinite alternate}
html:not(.fx-about) .Right-Image.fl{animation-delay:-3s}
@keyframes fxfl{to{translate:0 -10px}}
@media(prefers-reduced-motion:reduce){html:not(.fx-about) .fx-t{opacity:1!important;translate:none!important;filter:none!important}html:not(.fx-about) .main-header,html:not(.fx-about) .box-banner,html:not(.fx-about) .circle-badge,html:not(.fx-about) .fl{animation:none!important}}

/* ======================= ABOUT ======================= */
/* effects.css v3 — Iconnex House (หน้า about.php)
   โหลดเป็นไฟล์สุดท้าย ไม่แก้สี/ตำแหน่ง/ขนาดเดิม
   - ใช้เฉพาะ opacity / translate / scale / rotate (ตัวแปรเดี่ยว ไม่ชนกับ transform เดิม)
   - เอฟเฟกต์เปิดตัวทำด้วย animation แล้ว JS ลบ class ทิ้งตอนจบ → ของเดิมกลับมาเหมือนเดิม 100%
   - ไม่แตะ .main-header เลย (ต้นเหตุที่ dropdown ถูกบังรอบก่อน) */

/* ---------- แถบความคืบหน้าการเลื่อน (บางมาก ใช้สีเดิมของเว็บ) ---------- */
html.fx-about #fx-bar{position:fixed;top:0;left:0;height:2px;width:100%;background:linear-gradient(90deg,#FFD90D,#FFA200);transform-origin:0 50%;transform:scaleX(0);z-index:99999;pointer-events:none}

/* ---------- 1) ปรากฏเป็นจังหวะ ----------
   .fx-p = สถานะก่อนเล่น (JS ใส่ให้เอง จึงไม่มี JS = เห็นปกติ)
   .fx-go = เริ่มเล่น, จบแล้ว JS ลบทั้งสอง class */
.fx-p{opacity:0}
.fx-p.fx-go{animation-duration:1s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-delay:var(--fx-d,0s);animation-fill-mode:both}
.fx-rise.fx-go{animation-name:fx-rise}
.fx-text.fx-go{animation-name:fx-text;animation-duration:1.1s}
.fx-fade.fx-go{animation-name:fx-fade;animation-duration:1.4s;animation-timing-function:ease}
.fx-pop.fx-go{animation-name:fx-pop;animation-duration:1.1s}
@keyframes fx-rise{from{opacity:0;translate:0 34px}to{opacity:1;translate:0 0}}
@keyframes fx-text{from{opacity:0;translate:0 22px;filter:blur(6px)}to{opacity:1;translate:0 0;filter:blur(0)}}
@keyframes fx-fade{from{opacity:0}to{opacity:1}}
@keyframes fx-pop{from{opacity:0;scale:.92}to{opacity:1;scale:1}}

/* ---------- 2) เส้นที่ถูกวาดขึ้นมา (ใช้ scale ล้วน ไม่ชน transform เดิม) ---------- */
.fx-dx{scale:0 1;transform-origin:0 50%}
.fx-dy{scale:1 0;transform-origin:50% 0}
.fx-dx.fx-go{animation:fx-dx 1.1s cubic-bezier(.7,0,.2,1) var(--fx-d,0s) both}
.fx-dy.fx-go{animation:fx-dy 1.3s cubic-bezier(.7,0,.2,1) var(--fx-d,0s) both}
@keyframes fx-dx{from{scale:0 1}to{scale:1 1}}
@keyframes fx-dy{from{scale:1 0}to{scale:1 1}}
.card-yellow-line.fx-dx{transform-origin:50% 50%}

/* ---------- 3) เอียง 3 มิติตามเมาส์ (ใช้ตัวแปร rotate เดี่ยว ไม่ทับ transform:hover เดิม) ---------- */
html.fx-about .construction-container,html.fx-about .construction_2-container{perspective:1400px}
.fx-tilt{transition:rotate .55s cubic-bezier(.16,1,.3,1)}
.fx-tilt::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity .5s ease;
  background:radial-gradient(220px circle at var(--mx,50%) var(--my,50%),rgba(255,217,13,.085),transparent 55%)}
.fx-tilt.fx-hot::after{opacity:1}

/* ---------- 4) รายละเอียดตอนชี้ (เฉพาะอุปกรณ์ที่มีเมาส์จริง) ---------- */
@media (hover:hover) and (pointer:fine){
  html.fx-about .icon-circle{transition:translate .6s cubic-bezier(.16,1,.3,1),box-shadow .6s ease}
  html.fx-about .service-item:hover .icon-circle{translate:0 -6px;box-shadow:0 10px 26px rgba(255,217,13,.55)}
  html.fx-about .whychoose-icon-grid img{transition:scale .6s cubic-bezier(.16,1,.3,1)}
  html.fx-about .whychoose-icon-grid > div:hover img{scale:1.07}
}

/* ---------- 5) เมนู Service เลื่อนลงนุ่มๆ (ไม่มี fill-mode → จบแล้วไม่ค้าง stacking context) ---------- */
html.fx-about .dropdown.active .dropdown-menu{animation:fx-dd .38s cubic-bezier(.16,1,.3,1)}
@keyframes fx-dd{from{opacity:0;translate:0 -8px}to{opacity:1;translate:0 0}}

/* ---------- ลดการเคลื่อนไหว / พิมพ์ ---------- */
html.fx-about .circle-card span{font-variant-numeric:tabular-nums}
@media (prefers-reduced-motion:reduce){
  html.fx-about #fx-bar{display:none}
  .fx-p{opacity:1!important}
  .fx-p,.fx-dx,.fx-dy,html.fx-about .dropdown.active .dropdown-menu{animation:none!important;scale:none!important;translate:none!important}
  .fx-tilt{rotate:none!important}
}
@media print{.fx-p{opacity:1!important}.fx-dx,.fx-dy{scale:none!important}html.fx-about #fx-bar{display:none}}