/* ความเป็นเครื่องกล: กระดาษพิมพ์เขียว · เฟือง · มาตรวัดตัวเลข · ไอคอนเคลื่อนไหว */

/* ---------- กระดาษพิมพ์เขียว (ตารางละเอียด + เส้นหลักทุก 120px) ---------- */
.band.tint {
  background-color: var(--tint);
  background-image:
    linear-gradient(rgba(14, 39, 71, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 39, 71, .06) 1px, transparent 1px),
    linear-gradient(rgba(14, 39, 71, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 39, 71, .03) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}
.hero-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(14, 39, 71, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 39, 71, .09) 1px, transparent 1px),
    linear-gradient(rgba(14, 39, 71, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 39, 71, .045) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .55) 70%, rgba(0, 0, 0, .25) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .55) 70%, rgba(0, 0, 0, .25) 100%);
}

/* ---------- ชั้นเฟือง ---------- */
.mech-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: visible; }
.mech-cluster { position: absolute; display: block; max-width: none; overflow: visible; }
.banner-bar { position: relative; }
#about { overflow: hidden; }
.about-in { position: relative; z-index: 1; }
@media (max-width: 899px) { .mech-hero { display: none; } }

.mech-gear { color: #0e2747; }
.mech-gear .body { stroke-width: 1.6; stroke-linejoin: round; }
.mech-gear .pitch { fill: none; stroke: currentColor; stroke-opacity: .2; stroke-width: 1; stroke-dasharray: 5 4; }
.mech-gear .hub { fill: none; stroke: currentColor; stroke-opacity: .28; stroke-width: 1.2; }
.mech-gear .cl { fill: none; stroke: currentColor; stroke-opacity: .2; stroke-width: 1; stroke-dasharray: 16 4 3 4; }
.mech-gear.t-navy .body { fill: rgba(14, 39, 71, .07); stroke: rgba(14, 39, 71, .34); }
.mech-gear.t-crimson { color: #b3202a; }
.mech-gear.t-crimson .body { fill: rgba(179, 32, 42, .08); stroke: rgba(179, 32, 42, .5); }
.mech-gear.t-light { color: #fff; }
.mech-gear.t-light .body { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .26); }
.mech-gear.t-lightr { color: #ff7a85; }
.mech-gear.t-lightr .body { fill: rgba(255, 122, 133, .1); stroke: rgba(255, 122, 133, .5); }

/* ---------- เครื่องหมายมุมแบบแปลนที่กรอบวิดีโอ ---------- */
#videoWrap { position: relative; }
#videoWrap::before {
  content: ""; position: absolute; inset: -12px; pointer-events: none; z-index: 2;
  --c: #b3202a;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 26px 2px no-repeat, linear-gradient(var(--c), var(--c)) 0 0 / 2px 26px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 26px 2px no-repeat, linear-gradient(var(--c), var(--c)) 100% 0 / 2px 26px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 26px 2px no-repeat, linear-gradient(var(--c), var(--c)) 0 100% / 2px 26px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 26px 2px no-repeat, linear-gradient(var(--c), var(--c)) 100% 100% / 2px 26px no-repeat;
}

/* ---------- มาตรวัดตัวเลข (odometer) ---------- */
.stat b[data-count] { display: flex; align-items: center; gap: .06em; }
.odo { display: inline-flex; gap: .05em; }
.od { position: relative; display: block; height: 1.1em; padding: 0 .07em; overflow: hidden; border-radius: .12em;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05) 50%, rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, .05));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), inset 0 .1em .22em rgba(0, 0, 0, .28); }
.od::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .35); }
.reel { display: flex; flex-direction: column; transform: translateY(calc(var(--d) * -1.1em)); transition: transform 1.9s cubic-bezier(.16, .84, .24, 1); transition-delay: calc(var(--k, 0) * 140ms); }
.reel i { display: block; height: 1.1em; line-height: 1.1em; font-style: normal; text-align: center; }
.odo-pre .reel { transform: translateY(0); transition: none; }

/* ---------- ไอคอนงานวิจัยเคลื่อนไหว ---------- */
.area i svg { transform-origin: 50% 50%; }
.area.in.ic-snow i svg { animation: icSpin 9s linear infinite; }
.area.in.ic-flame i svg { animation: icFlicker 2.6s ease-in-out infinite; }
.area.in.ic-wind i svg, .area.in.ic-waves i svg { animation: icDrift 3.4s ease-in-out infinite; }
.area.in.ic-leaf i svg, .area.in.ic-gauge i svg { animation: icSway 3.8s ease-in-out infinite; }
.area.in.ic-car i svg, .area.in.ic-plane i svg, .area.in.ic-bot i svg { animation: icBob 3s ease-in-out infinite; }
.area.in.ic-scan i svg, .area.in.ic-grid i svg, .area.in.ic-sigma i svg, .area.in.ic-bone i svg { animation: icPulse 3.2s ease-in-out infinite; }
.area.in:nth-child(2n) i svg { animation-delay: -1.1s; }
.area.in:nth-child(3n) i svg { animation-delay: -2.2s; }
.area:hover i svg { animation-duration: .9s !important; }
.area:hover i { background: var(--accent); color: #fff; }
@keyframes icSpin { to { transform: rotate(360deg); } }
@keyframes icFlicker { 0%, 100% { transform: scale(1) translateY(0); } 30% { transform: scale(1.08, 1.16) translateY(-1px); } 60% { transform: scale(.95, 1.04) translateY(0); } }
@keyframes icDrift { 0%, 100% { transform: translateX(-1.6px); } 50% { transform: translateX(1.6px); } }
@keyframes icSway { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
@keyframes icBob { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-2px); } }
@keyframes icPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* ---------- ปุ่มกลับขึ้นบน (เฟือง + วงแหวนความคืบหน้า) ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--navy); cursor: pointer;
  box-shadow: 0 8px 24px rgba(14, 39, 71, .28); opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9); transition: opacity .25s, transform .25s, visibility 0s linear .25s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top:hover { box-shadow: 0 10px 28px rgba(14, 39, 71, .4); }
.to-top svg { width: 56px; height: 56px; overflow: visible; }
.to-top .track { fill: none; stroke: rgba(14, 39, 71, .12); stroke-width: 3; }
.to-top .prog { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.to-top .gear { fill: var(--navy); }
.to-top .up { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.to-top:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) { .to-top { right: 12px; bottom: 12px; width: 48px; height: 48px; } .to-top svg { width: 48px; height: 48px; } #videoWrap::before { inset: -8px; } }

@media (prefers-reduced-motion: reduce) {
  .reel { transition: none; }
  .to-top { transition: none; }
}
