:root {
  --black: #0d0d0d;
  --ink: #161616;
  --panel: #1f1f1f;
  --line: #2c2c2c;
  --white: #ffffff;
  --text: #2b2b2b;
  --muted: #8a8a8a;
  --red: #e10600;
  --red-dark: #b30500;
  --light: #f4f4f4;
  --font: "Roboto Condensed", "Kanit", -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--white); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Top bar + header */
.topbar { background: var(--red); color: #fff; text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .04em; padding: 7px 16px; }
.header { position: sticky; top: 0; z-index: 50; background: var(--ink); border-bottom: 1px solid #000; }
.header-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; }
.logo img { height: 40px; width: auto; }
.logo-text { color: #fff; font-weight: 800; font-size: 24px; letter-spacing: .06em; border: 2px dashed #555; padding: 2px 10px; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: #ddd; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; transition: color .15s; }
.nav a:hover { color: #fff; }
.nav .nav-cta { background: var(--red); color: #fff; padding: 8px 18px; border-radius: 40px; }
.nav .nav-cta:hover { background: var(--red-dark); }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; }

/* Hero */
.hero { position: relative; background: var(--black); color: #fff; overflow: hidden; min-height: 640px; display: flex; align-items: center; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.8s ease-in-out; will-change: transform, opacity; }
.hero-slide.on { opacity: .6; }
.hero-slide.kb { animation: kenburns 9s ease-out forwards; }
.hero-slide:nth-child(even).kb { animation-name: kenburns-alt; }
@keyframes kenburns { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.16) translate(-2.5%, -1%); } }
@keyframes kenburns-alt { from { transform: scale(1.16) translate(2%, 1%); } to { transform: scale(1.04) translate(0, 0); } }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; }
@media (prefers-reduced-motion: reduce) { .hero-slide.kb { animation: none; } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.15) 100%); }
.hero-in { position: relative; z-index: 1; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { color: var(--red); font-weight: 800; letter-spacing: .3em; font-size: 14px; margin: 0 0 12px; }
.hero h1 { font-size: clamp(38px, 6vw, 76px); line-height: 1.05; margin: 0 0 18px; font-weight: 800; text-transform: uppercase; }
.accent { color: var(--red); }
.hero-sub { font-size: 18px; color: #ccc; max-width: 520px; margin: 0 0 30px; font-weight: 300; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 48px; flex-wrap: wrap; }
.hero-stats div b { display: block; font-size: 36px; font-weight: 800; color: #fff; line-height: 1; }
.hero-stats div span { font-size: 13px; color: #aaa; text-transform: uppercase; letter-spacing: .1em; }

/* Hero logo: ลายเซ็นกำลังเซ็น + แสง */
.hero-logo { position: absolute; right: 24px; bottom: 64px; width: min(40vw, 560px); aspect-ratio: 1518 / 344; cursor: pointer; }
.hero-in > .hero-logo { opacity: 1; transform: none; animation: none; }
.hero-logo .hl-base, .hero-logo .hl-svg, .hero-logo .hl-shine { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-logo .hl-svg { overflow: visible; }
.hl-base { opacity: 0; transform: translateY(14px) scale(.97); filter: blur(6px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1), filter .9s ease; }
.hero-logo.base-in .hl-base { opacity: 1; transform: none; filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
.hl-sig-glow { opacity: .9; transition: opacity 1.2s ease; }
.hero-logo.done .hl-sig-glow { opacity: 0; }
.hero-logo.flash .hl-sig-glow { opacity: 1; transition: opacity .15s; }
.hl-shine {
  pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.95) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%; background-position: 160% 0;
  -webkit-mask: url(img/logo-base.png) center / 100% 100% no-repeat, url(img/logo-sign.png) center / 100% 100% no-repeat;
          mask: url(img/logo-base.png) center / 100% 100% no-repeat, url(img/logo-sign.png) center / 100% 100% no-repeat;
  mix-blend-mode: overlay; opacity: 0;
}
.hero-logo.shine .hl-shine { opacity: 1; animation: hlShine 1.3s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes hlShine { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.hl-spark { fill: #fff; }
@media (prefers-reduced-motion: reduce) { .hl-base { transition: none; } }

/* Buttons */
.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; padding: 13px 30px; border-radius: 40px; border: 2px solid transparent; cursor: pointer; transition: all .15s; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-ghost { border-color: #fff; color: #fff; background: transparent; }
.btn-ghost:hover { background: #fff; color: #000; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }

/* Sections */
.section { padding: 80px 0; }
.section.dark { background: var(--black); color: #fff; }
.title { font-size: clamp(26px, 3vw, 36px); font-weight: 800; text-transform: uppercase; margin: 0 0 10px; padding-bottom: 12px; border-bottom: 3px solid currentColor; display: block; }
.lead { color: var(--muted); margin: 14px 0 26px; }

/* Brand tiles */
.brand-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 32px; }
.brand-tile { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: var(--panel); cursor: pointer; border: 0; padding: 0; font: inherit; color: #fff; text-align: left; }
.brand-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.brand-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 60%); }
.brand-tile:hover img { transform: scale(1.06); }
.brand-tile .bt-label { position: absolute; left: 16px; bottom: 14px; z-index: 1; }
.brand-tile .bt-label b { display: block; font-size: 24px; font-weight: 800; text-transform: uppercase; line-height: 1.1; }
.brand-tile .bt-label span { font-size: 13px; color: #ccc; }
.brand-tile .bt-label span::before { content: ""; display: inline-block; width: 18px; height: 2px; background: var(--red); vertical-align: middle; margin-right: 8px; }

/* Filters */
.filters { display: grid; gap: 12px; margin-bottom: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 7px 16px; border-radius: 40px; border: 1.5px solid #ccc; background: #fff; color: #333; cursor: pointer; transition: all .12s; }
.chip:hover { border-color: #111; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips-sub .chip { font-size: 13px; padding: 5px 13px; border-color: #e3e3e3; background: var(--light); }
.chips-sub .chip.active { background: var(--red); border-color: var(--red); color: #fff; }
.chips-sub:empty { display: none; }
.chip small { opacity: .6; font-weight: 400; margin-left: 4px; }
.search { font: inherit; font-size: 15px; padding: 10px 18px; border: 1.5px solid #ccc; border-radius: 40px; max-width: 380px; width: 100%; outline: none; }
.search:focus { border-color: #111; }
.count { color: var(--muted); font-size: 14px; margin: 14px 0 18px; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { background: #fff; border: 1px solid #ececec; border-radius: 6px; overflow: hidden; cursor: pointer; transition: box-shadow .2s, transform .2s; text-align: left; padding: 0; font: inherit; color: inherit; }
.card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.12); transform: translateY(-3px); }
.card .ph { aspect-ratio: 16 / 10; background: var(--light); overflow: hidden; }
.card img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.card:hover img { transform: scale(1.04); }
.card .meta { padding: 12px 14px 14px; border-top: 1px solid #f0f0f0; }
.card .tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; }
.card h3 { font-size: 16px; margin: 6px 0 0; font-weight: 800; text-transform: uppercase; }
.card p { margin: 0; font-size: 13px; color: var(--muted); }
.more-wrap { text-align: center; margin-top: 34px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.steps li { background: var(--panel); border-radius: 6px; padding: 26px 20px; border-top: 3px solid var(--red); }
.steps b { font-size: 40px; font-weight: 800; color: var(--red); line-height: 1; }
.steps h3 { margin: 12px 0 6px; font-size: 20px; text-transform: uppercase; }
.steps p { margin: 0; color: #aaa; font-size: 14px; font-weight: 300; }

/* Footer */
.footer { background: var(--light); padding: 64px 0 0; }
.footer-in { display: grid; grid-template-columns: 1.3fr 1.2fr .8fr 1fr; gap: 40px; }
.qr img { width: 150px; height: 150px; background: #fff; padding: 8px; border-radius: 8px; border: 3px solid #06c755; transition: transform .25s; }
.qr a:hover img { transform: scale(1.05); }
.qr p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.contact .ic { flex: none; }
.footer-logo .logo-text { color: #111; border-color: #bbb; }
.footer-logo { background: var(--ink); padding: 12px 16px; border-radius: 6px; display: inline-flex; }
.footer-logo img { height: 44px; }
.footer h4 { text-transform: uppercase; font-size: 16px; font-weight: 800; margin: 0 0 14px; }
.muted { color: var(--muted); }
.contact, .foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.contact a { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.contact a:hover, .foot-links a:hover { color: var(--red); }
.contact .ic { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; }
.foot-links a { text-transform: uppercase; font-weight: 600; font-size: 14px; color: #444; cursor: pointer; }
.copy { border-top: 1px solid #ddd; margin-top: 48px; padding-top: 18px; padding-bottom: 18px; font-size: 13px; color: var(--muted); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; padding: 40px 70px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain; background: #fff; }
.lightbox figcaption { color: #fff; margin-top: 14px; text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.lightbox figcaption span { color: #999; font-weight: 400; margin-left: 10px; }
.lb-close { position: absolute; top: 12px; right: 18px; background: none; border: 0; color: #fff; font-size: 44px; cursor: pointer; line-height: 1; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.08); border: 0; color: #fff; font-size: 44px; width: 52px; height: 72px; cursor: pointer; border-radius: 4px; }
.lb-nav:hover { background: var(--red); }
.lb-prev { left: 10px; } .lb-next { right: 10px; }

/* ===== Animations ===== */
/* Header: เงาเมื่อเลื่อนลง */
.header { transition: box-shadow .3s, background .3s; }
.header.scrolled { box-shadow: 0 6px 24px rgba(0,0,0,.45); background: rgba(13,13,13,.94); backdrop-filter: blur(6px); }

/* Hero: ข้อความค่อยๆ ขึ้นมาทีละบรรทัด */
.hero-in > * { opacity: 0; transform: translateY(28px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-in > :nth-child(1) { animation-delay: .15s; }
.hero-in > :nth-child(2) { animation-delay: .3s; }
.hero-in > :nth-child(3) { animation-delay: .5s; }
.hero-in > :nth-child(4) { animation-delay: .65s; }
.hero-in > :nth-child(5) { animation-delay: .8s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero .accent { position: relative; display: inline-block; }
.hero .accent::after { content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .12em; background: var(--red); transform: scaleX(0); transform-origin: left; animation: underline .8s 1.1s cubic-bezier(.7,0,.2,1) forwards; }
@keyframes underline { to { transform: scaleX(1); } }

/* ลูกศรเลื่อนลง */
.scroll-hint { position: absolute; left: 50%; bottom: 22px; z-index: 2; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(255,255,255,.6); border-radius: 14px; }
.scroll-hint::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ปุ่ม: แสงวิ่งผ่าน */
.btn { position: relative; overflow: hidden; }
.btn::before { content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); transition: left .6s; }
.btn:hover::before { left: 130%; }
.btn-red { box-shadow: 0 0 0 0 rgba(225,6,0,.6); animation: pulse 2.4s 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(225,6,0,.55); } 70% { box-shadow: 0 0 0 14px rgba(225,6,0,0); } 100% { box-shadow: 0 0 0 0 rgba(225,6,0,0); } }

/* เลื่อนเห็นแล้วค่อยโผล่ */
.reveal.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.title { position: relative; border-bottom-color: transparent; }
.title::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 100%; height: 3px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 1s .2s cubic-bezier(.7,0,.2,1); }
.title.in::after { transform: scaleX(1); }
.title::before { content: ""; position: absolute; left: 0; bottom: -3px; width: 60px; height: 3px; background: var(--red); z-index: 1; transform: scaleX(0); transform-origin: left; transition: transform .6s 1s; }
.title.in::before { transform: scaleX(1); }

/* การ์ดแกลเลอรี: ขึ้นมาทีละใบเมื่อเปลี่ยนตัวกรอง */
.card { animation: cardIn .55s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d, 0s); }
@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.card .ph { position: relative; }
.card .ph::after { content: "ดูแบบขยาย"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(13,13,13,.55); color: #fff; font-weight: 700; letter-spacing: .08em; opacity: 0; transition: opacity .25s; }
.card:hover .ph::after { opacity: 1; }
.card .meta { position: relative; }
.card .meta::after { content: ""; position: absolute; left: 0; top: -1px; height: 3px; width: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .35s; }
.card:hover .meta::after { transform: scaleX(1); }

/* ไทล์ยี่ห้อ: เส้นแดงขยาย */
.brand-tile .bt-label span::before { transition: width .3s; }
.brand-tile:hover .bt-label span::before { width: 34px; }
.brand-tile { transition: transform .3s, box-shadow .3s; }
.brand-tile:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.5); }

/* ขั้นตอน: ตัวเลขเด้ง และเส้นแดงวิ่ง */
.steps li { position: relative; overflow: hidden; transition: transform .3s, background .3s; }
.steps li:hover { transform: translateY(-6px); background: #262626; }
.steps li.in b { display: inline-block; animation: pop .6s var(--d, 0s) both; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

/* Lightbox: ซูมเข้า */
.lightbox:not([hidden]) { animation: fadeIn .25s ease; }
.lightbox:not([hidden]) img { animation: zoomIn .35s cubic-bezier(.2,.7,.2,1); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.92); } }
.lightbox img.swap { animation: swapIn .35s ease; }
@keyframes swapIn { from { opacity: 0; transform: translateX(var(--dir, 20px)); } }

/* ปิดอนิเมชันสำหรับผู้ที่ตั้งค่าลดการเคลื่อนไหว */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 1024px) {
  .grid, .brand-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-in { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--ink); flex-direction: column; gap: 0; padding: 8px 0 16px; border-bottom: 2px solid var(--red); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 16px; width: 100%; text-align: center; }
  .nav .nav-cta { width: auto; margin-top: 8px; }
  .hero { min-height: 540px; }
  .hero::after { background: linear-gradient(0deg, rgba(0,0,0,.9) 10%, rgba(0,0,0,.45) 100%); }
  .hero-stats { gap: 24px; }
  .hero-logo { position: relative; right: auto; bottom: auto; width: 100%; max-width: 440px; margin-top: 36px; }
  .section { padding: 56px 0; }
  .grid, .brand-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .brand-tile .bt-label b { font-size: 18px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .footer-in { grid-template-columns: 1fr; gap: 28px; }
  .lightbox { padding: 50px 8px; }
  .lb-nav { width: 40px; height: 56px; font-size: 32px; top: auto; bottom: 14px; transform: none; }
  .card h3 { font-size: 14px; }
}
