/* ---------- หน้าหลัก: แกลเลอรี Virtual Production (Cyber Brutalism) ---------- */
html { scroll-behavior: smooth; }
.home .topbar { justify-content: space-between; }
.home a:not(.btn) { color: inherit; }
.home .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.btn .arr { font-family: var(--mono); font-size: 14px; line-height: 1; }

.nav { display: flex; gap: 0; flex: 1; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  padding: 7px 14px;
  transition: color .15s;
}
.nav a + a::before { content: "+"; color: var(--silver3); margin: 0 14px 0 -14px; position: relative; left: -2px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav a.nav-tool { color: var(--text); }
.sys-clock {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  line-height: 1.35;
  color: var(--muted);
  border-left: 1px solid var(--line2);
  border-right: 1px solid var(--line2);
  padding: 2px 14px;
  text-transform: uppercase;
  white-space: nowrap;
}
.sys-clock b { display: block; color: var(--text); font-weight: 500; }

/* ---------- Hero ---------- */
.hero-vp {
  position: relative;
  min-height: min(88vh, 840px);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  overflow: hidden;
  border-bottom: 1px solid var(--line2);
}
.hero-rail {
  position: relative;
  z-index: 2;
  border-right: 1px solid var(--line2);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 28px 0;
  background: rgba(5,5,5,.6);
}
.hero-rail .dots { display: grid; gap: 6px; }
.hero-rail .dots i { width: 3px; height: 3px; background: var(--silver3); display: block; }
.hero-rail .vert {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent);
}
.hero-rail .yr { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted); }

.hero-stage { position: relative; display: flex; align-items: flex-end; min-width: 0; }
.hero-slides, .hero-slides img { position: absolute; inset: 0; }
.hero-slides img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(1) contrast(1.15) brightness(.85);
  transform: scale(1.06);
  transition: opacity 1.4s ease, transform 7s linear;
}
.hero-slides img.on { opacity: 1; transform: scale(1); }
.hero-slides { overflow: hidden; container-type: size; }
/* วิดีโอ YouTube แบบ cover: ขยาย 16:9 ให้เต็มพื้นที่เสมอ (scale ซ่อนแถบชื่อ/โลโก้ของ YouTube) */
.hero-slides .hero-yt {
  position: absolute; top: 50%; left: 50%;
  width: max(100cqw, 177.78cqh); height: max(100cqh, 56.25cqw);
  transform: translate(-50%, -50%) scale(1.15);
  border: 0; pointer-events: none;
  filter: grayscale(1) contrast(1.15) brightness(.85);
}
.hero-slides::after {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(5,5,5,.94) 0%, rgba(5,5,5,.6) 45%, rgba(5,5,5,.1) 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 40%),
    radial-gradient(ellipse 45% 60% at 92% 20%, rgba(143,166,180,.28), transparent 70%),
    linear-gradient(135deg, transparent 55%, rgba(140,12,18,.32) 100%);
}
/* HUD overlay: crosshairs + readouts */
.hero-hud { position: absolute; inset: 0; pointer-events: none; z-index: 1; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.hero-hud .tl { position: absolute; top: 22px; right: 28px; text-align: right; }
.hero-hud .tl b { color: var(--accent); font-weight: 500; }
.hero-hud .br { position: absolute; bottom: 22px; right: 28px; color: var(--text); }
.hero-hud .cross { position: absolute; width: 14px; height: 14px; }
.hero-hud .cross::before, .hero-hud .cross::after { content: ""; position: absolute; background: var(--red); }
.hero-hud .cross::before { left: 6px; top: 0; width: 2px; height: 14px; }
.hero-hud .cross::after { top: 6px; left: 0; height: 2px; width: 14px; }
.hero-hud .c1 { top: 24%; right: 34%; }
.hero-hud .c2 { top: 64%; right: 12%; }
.hero-hud .ring { position: absolute; top: 20px; left: 28px; width: 18px; height: 18px; border: 1.5px solid var(--text); border-radius: 50%; }

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1400px;
  padding: 120px 28px 56px;
}
.hero-vp h1 {
  margin: 0;
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(52px, 9vw, 128px);
  line-height: .9;
  letter-spacing: -2px;
  text-transform: uppercase;
  color: var(--text);
  background: var(--silver-grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-vp h1 .slash { color: var(--accent); font-family: var(--mono); font-weight: 400; font-size: .32em; letter-spacing: 0; vertical-align: top; margin-left: 10px; }
.lead { max-width: 560px; margin: 22px 0 0; font-size: 16.5px; color: #c9c9c9; }
.hero-cta { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.hero-cta .btn { padding: 12px 20px; }

/* ---------- Sections ---------- */
.home-main { max-width: 1400px; margin: 0 auto; padding: 0 28px; }
.sec { padding: 64px 0 24px; scroll-margin-top: 70px; border-bottom: 1px solid var(--line2); }
.sec-head { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: baseline; margin-bottom: 28px; }
.sec-num { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 1px; }
.sec-num::before { content: "/"; }
.sec-head h1, .sec-head h2 { margin: 0; font-family: var(--head); font-weight: 700; font-size: clamp(26px, 3.4vw, 42px); line-height: 1.1; text-transform: uppercase; letter-spacing: -.5px; }
.sec-head p { grid-column: 2; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
/* ---------- Video mosaic: แถบชื่อ + [ ลิงก์ ] / ตารางภาพเต็มจอ ชิดกัน ---------- */
body.home { overflow-x: clip; }
.vid-bar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap;
  padding: 0 0 8px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
}
.vid-read { min-height: 1.5em; color: var(--muted); min-width: 0; }
.vid-read b { color: var(--accent); font-weight: 500; }
.vid-read #vidReadTitle { color: var(--text); }
.vid-links { display: flex; gap: 6px 26px; flex-wrap: wrap; }
.vid-links a { color: var(--text); text-decoration: none; white-space: nowrap; }
.vid-links a::before { content: "[ "; color: var(--muted); }
.vid-links a::after { content: " ]"; color: var(--muted); }
.vid-links a:hover { color: var(--accent); }
/* ตารางเต็มความกว้างจอ (ทะลุ padding ของ .home-main) */
.vid-wall {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  --bleed: calc(100vw - var(--sbw, 0px));
  width: var(--bleed); margin-left: calc(50% - var(--bleed) / 2);
  background: #000;
}
.vid {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0; border-radius: 0;
  background: #0b0b0b;
  overflow: hidden;
  cursor: pointer;
}
.vid img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: grayscale(1) contrast(1.1) brightness(.85);
  transition: opacity .3s, transform .5s, filter .35s;
}
/* ขาวดำปกติ → ชี้ที่ภาพแล้วมีสี / ภาพอื่นจางลง */
.vid-wall:hover .vid:not(:hover) img { opacity: .35; }
.vid:hover img, .vid:focus-visible img { filter: none; transform: scale(1.05); }
.vid:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }

/* ---------- Photo filter + point cloud forest ---------- */
.chips.filter button { padding: 7px 14px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.chips.filter .n { margin-left: 8px; opacity: .55; font-variant-numeric: tabular-nums; }


/* ป่าเต็มหน้าจอ: กว้างเต็มจอ (ไม่ล้นใต้ scrollbar) สูงเต็มความสูงจอ */
#photos { padding: 0; scroll-margin-top: var(--tbh, 0px); }
.pc {
  position: relative;
  --bleed: calc(100vw - var(--sbw, 0px));
  width: var(--bleed); margin-left: calc(50% - var(--bleed) / 2);
  height: calc(100vh - var(--tbh, 0px)); height: calc(100svh - var(--tbh, 0px)); min-height: 420px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 30% at 50% 44%, rgba(143,166,180,.09), transparent 70%),
    radial-gradient(ellipse 60% 35% at 50% 100%, var(--red-dim), transparent 70%),
    linear-gradient(180deg, #030303 0%, var(--bg2) 44%, #070707 100%);
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.pc.hot { cursor: zoom-in; }
.pc-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.pc-actor {
  position: absolute; left: 0; top: 0; height: 100px; width: auto; transform-origin: 0 0;
  pointer-events: none; user-select: none; image-rendering: pixelated; opacity: 0; z-index: 1;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7));
}
.pc-off .pc-actor { display: none; }
/* ปุ่มต่อภาพ: ซ่อนไว้สำหรับคีย์บอร์ด/โปรแกรมอ่านจอ (โฟกัสแล้วต้นไม้นั้นเปิดภาพ) */
.pc-tiles { position: absolute; left: 0; top: 0; }
.ph {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%);
  padding: 0; border: 0; background: none;
}
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* ภาพเต็มที่ขึ้นแทนกลุ่มจุดของต้นไม้ที่ถูกชี้ */
.pc-reveal {
  position: absolute; z-index: 2;
  padding: 0; border: 0; border-radius: 0; background: #000;
  cursor: zoom-in;
  opacity: 0; pointer-events: none;
  clip-path: inset(0 0 100% 0);
  transition: opacity .25s, clip-path .4s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 18px 50px rgba(0,0,0,.7);
}
.pc-reveal.on { opacity: 1; pointer-events: auto; clip-path: inset(-60px); }
.pc-reveal img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* กรอบเล็งมุมภาพ + ป้าย slate (SCN / หมวด / ไฟล์) เหนือภาพ */
.pc-reveal::before, .pc-reveal::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none;
  border: 2px solid var(--accent);
}
.pc-reveal::before { left: -8px; top: -8px; border-right: 0; border-bottom: 0; }
.pc-reveal::after { right: -8px; bottom: -8px; border-left: 0; border-top: 0; }
.pc-cap {
  position: absolute; left: 0; bottom: calc(100% + 10px);
  display: flex; gap: 10px; align-items: center; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  text-align: left;
}
.pc-cap b { background: var(--accent); color: #000; font-weight: 600; padding: 2px 6px; }
.pc-cap span + span::before { content: "// "; color: var(--silver3); }
.pc-cap #capCat { color: var(--text); }

/* ภาพรวมป่า: vignette + เส้นสแกน */
.pc::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px),
    linear-gradient(0deg, rgba(5,5,5,.9) 0%, transparent 32%),
    radial-gradient(ellipse 80% 75% at 50% 45%, transparent 55%, rgba(0,0,0,.65) 100%);
}
.pc-reveal { z-index: 3; }

/* ---------- HUD บนป่า ---------- */
.pc-hud { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.pc-hud::before {   /* เส้นสแกนวิ่งจากบนลงล่าง */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 120px;
  background: linear-gradient(180deg, transparent, rgba(143,166,180,.06) 85%, rgba(230,40,48,.35) 100%);
  animation: pcSweep 7s linear infinite;
}
@keyframes pcSweep { from { transform: translateY(-120px); } to { transform: translateY(calc(100vh + 120px)); } }
.pc-corner { position: absolute; width: 22px; height: 22px; border: 1.5px solid var(--silver3); }
.pc-corner.c1 { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.pc-corner.c2 { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.pc-corner.c3 { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.pc-corner.c4 { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }

@keyframes pcRise { from { opacity: 0; transform: translateY(26px); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(-20px); } }

.pc-filter { position: absolute; top: 44px; left: 44px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: auto; animation: pcRise .8s .45s cubic-bezier(.2,.7,.2,1) both; }
.pc-filter button {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line2); border-radius: 0;
  background: rgba(5,5,5,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase;
  transition: color .15s, border-color .15s, background .15s;
}
.pc-filter button:hover { color: var(--text); border-color: var(--silver3); }
.pc-filter button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.pc-filter .n { font-size: 10px; opacity: .6; font-variant-numeric: tabular-nums; }

.pc-read {
  position: absolute; top: 44px; right: 44px; text-align: right;
  font-family: var(--mono); font-size: 11px; line-height: 1.7; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
}
.pc-read b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.pc-read .rec { color: var(--accent); }
.pc-read .rec::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(1) infinite; }
.pc-read .auto-tag { display: none; margin-left: 12px; padding: 0 6px; background: var(--accent); color: #000; animation: blink .8s steps(1) infinite; }
.pc.auto .pc-read .auto-tag { display: inline-block; }
.pc-hint {
  position: absolute; right: 44px; bottom: 40px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
}
.pc-hint::before { content: "▸ "; color: var(--accent); }

/* เป้าเล็งตามเมาส์ */
.pc-aim { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .2s; }
.pc.aiming .pc-aim { opacity: 1; }
.pc.hot .pc-aim { opacity: .35; }
.pc-aim i { position: absolute; background: rgba(143,166,180,.22); }
.pc-aim .h { left: -200vw; width: 400vw; top: 0; height: 1px; }
.pc-aim .v { top: -200vh; height: 400vh; left: 0; width: 1px; }
.pc-aim::before {
  content: ""; position: absolute; left: -11px; top: -11px; width: 20px; height: 20px;
  border: 1.5px solid var(--accent); border-radius: 50%;
}
.pc-aim span { position: absolute; left: 14px; top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--accent); white-space: nowrap; }

/* สำรอง: ไม่มี WebGL2 → ตารางรูปปกติ */
.pc-off { width: auto; margin-left: 0; height: auto; min-height: 0; overflow: visible; background: none; }
.pc-off .pc-canvas, .pc-off .pc-reveal { display: none; }
.pc-off { display: flex; flex-direction: column; }
.pc-off::after, .pc-off .pc-aim, .pc-off .pc-read, .pc-off .pc-hint, .pc-off .pc-corner, .pc-off .pc-hud::before { display: none; }
.pc-off .pc-hud { position: static; order: -1; display: flex; flex-direction: column-reverse; gap: 20px; padding: 40px 0 24px; }
.pc-off .pc-filter { position: static; max-width: none; }
.pc-off .pc-tiles { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px; }
.pc-off .ph { position: relative; width: auto; height: auto; aspect-ratio: 3 / 2; clip-path: none; cursor: zoom-in; }
.pc-off .ph img { filter: grayscale(1) contrast(1.08) brightness(.85); transition: filter .3s; }
.pc-off .ph:hover img, .pc-off .ph:focus-visible img { filter: none; }

/* ---------- Tool CTA ---------- */
.tool-cta {
  margin: 64px 0 64px;
  padding: 32px 36px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background:
    linear-gradient(90deg, var(--accent-dim), transparent 55%),
    radial-gradient(ellipse 40% 120% at 100% 50%, var(--steel-dim), transparent 70%),
    var(--panel);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  position: relative;
}
.tool-cta h2 { margin: 0; font-family: var(--head); font-weight: 700; font-size: 26px; text-transform: uppercase; }
.tool-cta p { margin: 6px 0 0; color: var(--muted); max-width: 620px; }
.tool-cta .btn { padding: 12px 20px; }
.tool-cta .cta-btns { display: flex; flex-direction: column; gap: 10px; }

.home-foot {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  padding: 24px 28px 24px;
  border-top: 1px solid var(--line2);
  color: var(--muted); font-family: var(--mono); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
}
.home-foot img { height: 32px; }
.barcode { height: 10px; width: 140px; background: repeating-linear-gradient(90deg, var(--text) 0 6px, transparent 6px 8px, var(--text) 8px 10px, transparent 10px 14px, var(--text) 14px 22px, transparent 22px 25px); }
.hazard {
  height: 26px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 18px, var(--bg) 18px 36px);
  display: grid; place-items: center;
}
.hazard span {
  background: var(--bg); color: var(--accent);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase;
  padding: 3px 18px; border-left: 1px solid var(--accent); border-right: 1px solid var(--accent);
}
.hazard span::after { content: "_"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Lightbox ---------- */
body.lb-open { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3,3,3,.96);
  display: flex; align-items: center; justify-content: center;
}
.lb-stage { width: min(92vw, 1600px); height: 86vh; display: flex; align-items: center; justify-content: center; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border: 1px solid var(--line2); }
.lb-stage .yt { width: 100%; max-height: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line2); background: #000; }
.lb.video .lb-stage { height: auto; }
.lb-close, .lb-nav {
  position: absolute;
  border: 1px solid var(--line2);
  background: rgba(10,10,10,.85);
  color: var(--text);
  border-radius: 0;
  cursor: pointer;
  display: grid; place-items: center;
  font-family: var(--mono);
  line-height: 1;
}
.lb-close { top: 16px; right: 16px; width: 44px; height: 44px; font-size: 24px; }
.lb-nav { top: 50%; width: 48px; height: 48px; margin-top: -24px; font-size: 26px; padding-bottom: 3px; }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
.lb-close:hover, .lb-nav:hover { border-color: var(--accent); color: var(--accent); }
.lb.video .lb-nav, .lb.video .lb-count { display: none; }
.lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: var(--accent); font-family: var(--mono); font-size: 12px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
/* lightbox ภาพเบื้องหลัง: ป้าย slate + แถบฟิล์ม + ภาพเปิดแบบกวาด */
.lb-cap, .lb-strip { display: none; }
.lb.photo-ui .lb-stage { height: calc(100vh - 190px); margin-bottom: 70px; }
.lb.photo-ui .lb-stage img { animation: lbIn .55s cubic-bezier(.2,.7,.2,1); }
@keyframes lbIn { from { clip-path: inset(0 100% 0 0); filter: grayscale(1) brightness(1.8); } to { clip-path: inset(0); filter: none; } }
.lb.photo-ui .lb-count { bottom: 98px; }
.lb.photo-ui .lb-cap {
  display: flex; gap: 10px; align-items: center;
  position: absolute; top: 26px; left: 24px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
}
.lb-cap b { background: var(--accent); color: #000; font-weight: 600; padding: 2px 7px; }
.lb-cap span:first-of-type { color: var(--text); }
.lb-cap span::before { content: "// "; color: var(--silver3); }
.lb.photo-ui .lb-strip {
  display: flex; gap: 4px;
  position: absolute; left: 0; right: 0; bottom: 0; height: 84px;
  padding: 12px 16px;
  overflow-x: auto; scrollbar-width: none;
  border-top: 1px solid var(--line2);
  background: rgba(0,0,0,.6);
}
.lb-strip::-webkit-scrollbar { display: none; }
.lb-strip button {
  flex: 0 0 auto; height: 100%; aspect-ratio: 3 / 2; padding: 0; border: 0; border-radius: 0;
  background: #111; cursor: pointer;
  opacity: .35; filter: grayscale(1);
  transition: opacity .2s, filter .2s;
}
.lb-strip button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb-strip button:hover { opacity: .85; filter: none; }
.lb-strip button.on { opacity: 1; filter: none; outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .sys-clock { display: none; }
  .vid-wall { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .home .topbar { position: sticky; flex-wrap: wrap; row-gap: 0; padding: 8px 16px 0; }
  .vid-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* เมนูย้ายลงเป็นแถวที่สองใต้โลโก้ เลื่อนแนวนอนได้ถ้ายาวเกิน */
  .home .nav {
    order: 3; flex: 0 0 auto; width: calc(100% + 32px); margin: 8px -16px 0;
    justify-content: flex-start; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none;
    border-top: 1px solid var(--line2);
  }
  .home .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: 11px; padding: 9px 16px; white-space: nowrap; }
  .nav a + a::before { margin: 0 16px 0 -16px; }
  .hero-vp { min-height: 80vh; grid-template-columns: 1fr; }
  .hero-rail, .hero-hud .c1 { display: none; }
  .hero-slides::after {
    background:
      repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px),
      linear-gradient(0deg, var(--bg) 0%, rgba(5,5,5,.82) 45%, rgba(5,5,5,.15) 80%);
  }
  .hero-inner { padding: 90px 16px 40px; }
  .hero-hud .tl { right: 16px; }
  .hero-hud .br { display: none; }
  .lead { font-size: 15px; }
  .home-main { padding: 0 16px; }
  .sec { padding-top: 48px; }
  .sec-head .sec-links { grid-column: 1 / -1; gap: 16px; }
  .tool-cta { padding: 26px 20px; }
  .home-foot { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 16px; }
  .lb-nav { top: auto; bottom: 14px; margin: 0; width: 46px; height: 46px; }
  .lb-stage { width: 100vw; height: 78vh; }
  .lb.photo-ui .lb-nav { bottom: 96px; }
  .lb.photo-ui .lb-count { bottom: 110px; }
  .lb.photo-ui .lb-stage { height: calc(100vh - 230px); }
  .pc-read, .pc-hint, .pc-aim { display: none; }
  .pc-filter { top: 20px; left: 20px; right: 20px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pc-filter button { flex: 0 0 auto; padding: 7px 11px; font-size: 10.5px; }
  .pc-corner { display: none; }
}
@media (max-width: 480px) {
  .vid-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand { height: 30px; }
  .hero-vp h1 { font-size: 46px; letter-spacing: -1px; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  .tool-cta .cta-btns, .tool-cta .btn { width: 100%; justify-content: center; white-space: normal; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slides img { transition: opacity .6s; transform: none !important; }
  .hazard span::after { animation: none; }
  .pc-hud::before { display: none; }
  .pc-filter, .lb.photo-ui .lb-stage img, .pc-read .rec::before { animation: none; }
}

/* ---------- Logo intro (วิดีโอโลโก้เปิดเว็บ) ---------- */
.intro { display: none; }
.intro-on body { overflow: hidden; }
.intro-on .intro {
  display: grid;
  place-items: center;
  position: fixed; inset: 0;
  z-index: 100;
  background: #000;
  transition: opacity .7s ease, visibility .7s;
}
.intro.out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.intro-ui {
  position: absolute; right: 20px; bottom: 26px;
  display: flex; gap: 8px;
}
.intro-ui button {
  border: 1px solid var(--line2);
  background: rgba(0,0,0,.55);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 7px 12px;
  cursor: pointer;
}
.intro-ui button:hover, .intro-ui button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.intro-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.06); }
.intro-bar i { display: block; height: 100%; width: 0; background: var(--red-grad); }
