/* BreXus — ภาพเปิดเว็บ (brexus-intro.js) เล่นรอบเดียว ~3.35 วินาที
   ลำดับ: ลูกศรเมาส์เลื่อนเป็นเส้นทแยงตรงจากขวาล่างมาที่กลางตัว X 0–1.0s → คลิก 1.0–1.17s
   → วงแดงกระเพื่อม + ตัว X เปิดออกจากวงกลม 1.07–1.5s (ลูกศรจาง 1.25–1.45s)
   → พิมพ์ทีละตัว B 1.55s · r 1.65s · e 1.75s · (ข้ามตัว X) u 1.87s · s 1.97s → เคอร์เซอร์หาย 2.07s
   → โลโก้หดแล้วเด้งกลับเหมือนกด Enter 2.11–2.45s → แช่ไว้ 0.5 วินาที → ภาพเปิดจางออกที่ 2.95s (ตั้งเวลาใน brexus-intro.js)
   แผ่นปิดตัวอักษรหดจากซ้ายไปขวาเร็ว ๆ (0.06s) ให้ดูเหมือนตัวอักษรถูกพิมพ์ */
.brexus-intro { --bxi-bg: #fff; --bxi-red: #e31846; --bxi-ink: #111; position: fixed; inset: 0; z-index: 2000; background: var(--bxi-bg); display: grid; place-items: center; cursor: pointer; transition: opacity .4s ease; }
.brexus-intro.out { opacity: 0; pointer-events: none; }
.brexus-intro svg { width: min(560px, 78vw); height: auto; overflow: visible; }
.brexus-intro .bxi-red, .brexus-intro .bxi-ripple { fill: var(--bxi-red); }
.brexus-intro .bxi-ink, .brexus-intro .bxi-pointer, .brexus-intro .bxi-caret { fill: var(--bxi-ink); }
.brexus-intro .bxi-cover { fill: var(--bxi-bg); transform-box: fill-box; transform-origin: right center; }

/* 1) ลูกศรเข้ามาคลิก — ปลายลูกศรอยู่ที่มุมซ้ายบนของกรอบรูป (560, 478) = จุดคลิก */
.brexus-intro .bxi-pointer { transform-box: fill-box; transform-origin: left top; animation: bxi-enter 1s cubic-bezier(.25,.6,.3,1) both, bxi-click .17s ease-in-out 1s, bxi-fade .2s ease 1.25s forwards; }
/* 2) วงแดงกระเพื่อม + ตัว X เปิด */
.brexus-intro .bxi-ripple { transform-box: fill-box; transform-origin: center; animation: bxi-ripple .45s cubic-bezier(.2,.7,.3,1) 1.07s both; }
.brexus-intro .bxi-iris { transform-origin: center; animation: bxi-iris .35s cubic-bezier(.55,0,.75,.2) 1.15s both; }
/* 3) พิมพ์ B r e u s */
.brexus-intro .bxi-cb { animation: bxi-wipe .06s linear 1.49s both; }
.brexus-intro .bxi-cr { animation: bxi-wipe .06s linear 1.59s both; }
.brexus-intro .bxi-ce { animation: bxi-wipe .06s linear 1.69s both; }
.brexus-intro .bxi-cu { animation: bxi-wipe .06s linear 1.81s both; }
.brexus-intro .bxi-cs { animation: bxi-wipe .06s linear 1.91s both; }
.brexus-intro .bxi-caret { animation: bxi-type 2s .45s both; }
/* 4) กด Enter — ทั้งโลโก้หดลงแล้วเด้งกลับ */
.brexus-intro .bxi-all { transform-box: fill-box; transform-origin: center; animation: bxi-enter-key .34s cubic-bezier(.3,0,.3,1) 2.11s both; }

/* เส้นทางเมาส์: เส้นทแยงตรงจากขวาล่างขึ้นมาที่กลางตัว X แล้วชะลอก่อนหยุด (หน่วย = พิกัดใน viewBox) */
@keyframes bxi-enter {
  0% { transform: translate(320px, 320px); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(0, 0); opacity: 1; }
}
@keyframes bxi-click { 0%, 100% { transform: scale(1); } 50% { transform: scale(.82); } }
@keyframes bxi-fade { to { opacity: 0; } }
@keyframes bxi-ripple { 0% { transform: scale(0); opacity: .9; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes bxi-iris { from { transform: scale(1); } to { transform: scale(0); } }
@keyframes bxi-wipe { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* เคอร์เซอร์อยู่ท้ายตัวที่พิมพ์ล่าสุด — กระโดดเป็นจังหวะ (step-end) ไม่ไหลลื่น */
@keyframes bxi-type {
  0% { opacity: 0; transform: translateX(0); animation-timing-function: step-end; }
  52% { opacity: 1; transform: translateX(0); animation-timing-function: step-end; }
  55% { opacity: 1; transform: translateX(205px); animation-timing-function: step-end; }
  60% { opacity: 1; transform: translateX(338px); animation-timing-function: step-end; }
  65% { opacity: 1; transform: translateX(526px); animation-timing-function: step-end; }
  71% { opacity: 1; transform: translateX(808px); animation-timing-function: step-end; }
  76% { opacity: 1; transform: translateX(1015px); animation-timing-function: step-end; }
  81%, 100% { opacity: 0; transform: translateX(1015px); }
}
@keyframes bxi-enter-key { 0% { transform: scale(1); } 35% { transform: scale(.94); } 70% { transform: scale(1.02); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .brexus-intro { display: none; } }
/* โหมดมืดของเว็บ (html[data-site-theme="dark"]) */
html[data-site-theme="dark"] .brexus-intro { --bxi-bg: #0f1012; --bxi-ink: #e5e7eb; }
