/* โทนตามสไลด์คอร์ส: ดำ #151515 · ส้ม #EF4E16 · พื้นเทาอ่อน · Kanit + Bebas Neue (ตัวเลขและชื่อบทภาษาอังกฤษ) */
:root {
  --ink: #151515; --ink-2: #3d3d42; --grey: #6b6b73; --line: #dcdce2;
  --paper: #f1f1f3; --card: #ffffff;
  --dark: #151515; --dark-2: #232326; --dark-line: #3a3a40; --on-dark: #f4f4f6; --on-dark-2: #b9b9c0;
  --orange: #ef4e16; --orange-press: #d8430f; --orange-text: #b8360b; --orange-soft: #fde6dc;
  --ok: #1f7a3a; --ok-soft: #e3f2e7; --err: #b42318; --err-soft: #fdecea;
  --thai: "Kanit", "Noto Sans Thai", system-ui, sans-serif;
  --num: "Bebas Neue", "Kanit", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--thai); font-weight: 300; font-size: 17px; line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--thai); font-weight: 600; line-height: 1.22; margin: 0; text-wrap: balance; }
p, figure, dl, dd, ol, ul { margin: 0; }
b, strong { font-weight: 500; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 560px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ส่วนหัว */
.top { background: var(--dark); color: var(--on-dark); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--dark-line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { font-family: var(--num); font-size: 1.45rem; letter-spacing: .04em; text-decoration: none; line-height: 1; padding-top: 3px; }
.brand span { color: var(--orange); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a, .nav button { color: var(--on-dark); text-decoration: none; font: inherit; font-weight: 400; font-size: .95rem; background: none; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.nav a:hover, .nav button:hover { background: var(--dark-2); }
.demo-bar { background: #fff1c9; color: #5c4300; font-size: .88rem; font-weight: 400; text-align: center; padding: 6px 16px; }

/* ปุ่ม: พื้นส้ม ตัวหนังสือดำ แบบปกสไลด์ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--thai); font-weight: 500; font-size: 1.02rem; line-height: 1.3; border: 0; border-radius: 6px; padding: 13px 22px; cursor: pointer; text-decoration: none; background: var(--orange); color: var(--ink); }
.btn:hover { background: var(--orange-press); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #303034; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.ghost:hover { background: rgba(127, 127, 127, .16); }
.btn.block { width: 100%; }
.btn.small { padding: 9px 16px; font-size: .95rem; }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 400; font-size: .95rem; color: var(--orange-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ตัวเลขและชื่อบทภาษาอังกฤษ */
.num { font-family: var(--num); letter-spacing: .03em; line-height: 1; }
.price { font-family: var(--num); font-size: 2rem; letter-spacing: .02em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price small { font-family: var(--thai); font-weight: 400; font-size: .95rem; letter-spacing: 0; margin-left: 4px; }
.owned { color: var(--ok); font-weight: 500; }
.muted { color: var(--grey); font-size: .93rem; }
.nw { white-space: nowrap; }

/* ฮีโร่: โชว์รูมราวแขวน */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }
.hero { background: var(--dark); color: var(--on-dark); }
.showroom { position: relative; overflow: hidden; padding-top: 44px; background: radial-gradient(80% 55% at 50% 58%, #34343b 0%, #1e1e22 46%, var(--dark) 80%); }
.pitch { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: end; }
.hero .org { display: flex; align-items: center; gap: 14px; font-weight: 400; font-size: .95rem; color: var(--on-dark-2); }
.hero .org img { height: 68px; width: auto; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 4.1rem); line-height: 1.1; margin-top: 14px; }
.hero .lede { color: var(--on-dark-2); font-size: 1.05rem; max-width: 46ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero .teacher { margin-top: 20px; color: var(--on-dark-2); font-size: .95rem; }
.hero .teacher b { color: var(--on-dark); }

.rack { position: relative; margin-top: 46px; }
.rack-hint { text-align: center; color: var(--on-dark-2); font-size: .9rem; margin-bottom: 14px; }
.rackbody { position: relative; perspective: 1300px; perspective-origin: var(--px, 50%) 34%; }
.rail { position: absolute; left: 0; right: 0; top: 3px; height: 6px; border-radius: 3px; background: linear-gradient(#fafafc, #9a9aa3 55%, #4a4a51); box-shadow: 0 8px 22px rgba(0, 0, 0, .55); }
.rail::before, .rail::after { content: ""; position: absolute; top: -5px; width: 5px; height: 16px; border-radius: 2px; background: #d0d0d6; }
.rail::before { left: 0; } .rail::after { right: 0; }
.pieces { --w: clamp(120px, 12vw, 150px); --slot: .255; position: relative; z-index: 1; display: flex; justify-content: center; align-items: flex-start; padding-top: 2px; min-height: calc(var(--w) * 2.05); transform-style: preserve-3d; transform: rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease); }
.piece { position: relative; flex: 0 0 calc(var(--w) * var(--slot)); min-width: 0; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; transform-style: preserve-3d; transition: flex-basis .6s var(--ease); z-index: 1; -webkit-tap-highlight-color: transparent; }
.piece.on { flex-basis: calc(var(--w) * 1.35); z-index: 3; }
.piece:focus-visible { outline: none; }
.piece:focus-visible .garment { outline: 3px solid #fff; outline-offset: 3px; }
.hang { display: block; flex: none; width: var(--w); transform-style: preserve-3d; transform-origin: 50% 0; transform: rotateY(-63deg); filter: brightness(.72); transition: transform .65s var(--ease), filter .45s ease; }
.piece.on .hang { transform: translateZ(60px) rotateY(var(--ty, 0deg)) rotateX(var(--tx, 0deg)); filter: none; }
.sway { position: relative; display: block; transform-style: preserve-3d; transform-origin: 50% 0; animation: sway 5.5s ease-in-out infinite; animation-delay: calc(var(--i) * -.9s); }
.piece.on .sway { animation: settle 1s var(--ease) 1, sway 5.5s ease-in-out 1s infinite; }
.garment { display: block; width: calc(100% * var(--s, 1)); height: auto; margin-inline: auto; filter: drop-shadow(0 0 1px rgba(255, 255, 255, .5)) drop-shadow(0 26px 26px rgba(0, 0, 0, .6)); }
.piece.on .garment { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .6)) drop-shadow(0 0 26px rgba(255, 255, 255, .16)) drop-shadow(0 34px 30px rgba(0, 0, 0, .65)); }
.sway .no { position: absolute; left: 2px; top: calc(var(--w) * .42); font-family: var(--num); font-size: 2.4rem; line-height: 1; color: #fff; text-shadow: 0 6px 14px rgba(0, 0, 0, .6); opacity: 0; transition: transform .65s var(--ease), opacity .3s ease; }
.piece.on .no { opacity: 1; transform: translateZ(38px); }
.htag { position: absolute; right: -12%; top: 96px; min-width: 58px; padding: 16px 9px 6px; border-radius: 3px; background: var(--orange); color: var(--ink); font-family: var(--num); font-size: 1.5rem; line-height: 1; text-align: center; transform-origin: 50% -34px; transform: translateZ(0) rotate(9deg) scale(.6); opacity: 0; transition: opacity .3s ease, transform .6s var(--ease); box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .7); }
.htag::before { content: ""; position: absolute; left: 50%; top: 5px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--dark); }
.htag::after { content: ""; position: absolute; left: 50%; bottom: calc(100% - 8px); width: 1px; height: 36px; background: #dedee4; }
.piece.on .htag, .htag.show { opacity: 1; transform: translateZ(64px) rotate(7deg) scale(1); animation: dangle 3.2s ease-in-out .6s infinite; }
.floor { position: absolute; left: -12%; right: -12%; bottom: -8px; height: 120px; pointer-events: none; background: radial-gradient(46% 100% at 50% 100%, rgba(239, 78, 22, .2), transparent 72%), linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 100% 20px, linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px) 50% 0 / 56px 100%; -webkit-mask-image: radial-gradient(60% 100% at 50% 100%, #000, transparent 75%); mask-image: radial-gradient(60% 100% at 50% 100%, #000, transparent 75%); transform: perspective(420px) rotateX(58deg); transform-origin: 50% 100%; }
@keyframes sway { 0%, 100% { transform: rotateZ(-.7deg); } 50% { transform: rotateZ(.7deg); } }
@keyframes settle { 0% { transform: rotateZ(-5deg); } 35% { transform: rotateZ(3deg); } 65% { transform: rotateZ(-1.6deg); } 100% { transform: rotateZ(-.7deg); } }
@keyframes dangle { 0%, 100% { transform: translateZ(64px) rotate(7deg); } 50% { transform: translateZ(64px) rotate(-4deg); } }

/* แสงสปอตไลต์ตามเมาส์ และประกายลอย */
.showroom::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 46%), rgba(255, 255, 255, .13), transparent 70%); }
.showroom > .wrap, .showroom > .ticker { position: relative; z-index: 1; }
.motes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.motes i { position: absolute; bottom: -24px; font-style: normal; font-size: calc(.7rem * var(--z)); color: var(--orange); opacity: 0; animation: mote var(--d) linear var(--w) infinite; }
.motes i:nth-child(3n) { color: #fff; }
@keyframes mote { 0% { transform: translateY(0) rotate(0deg); opacity: 0; } 12% { opacity: .7; } 80% { opacity: .5; } 100% { transform: translateY(-78vh) rotate(160deg); opacity: 0; } }

/* ภาพโฆษณาเต็มจอ ซ้อนกันตอนสกรอลล์ */
.campaign { background: var(--dark); }
.campaign figure { position: sticky; top: 60px; height: calc(100vh - 60px); min-height: 420px; overflow: hidden; }
.campaign img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.campaign figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .12) 46%, transparent 62%); pointer-events: none; }
.campaign figcaption { position: absolute; z-index: 1; left: max(18px, calc((100vw - 1120px) / 2 + 18px)); bottom: clamp(28px, 9vh, 84px); max-width: min(440px, calc(100vw - 36px)); color: #fff; display: grid; gap: 8px; justify-items: start; }
.campaign figcaption span { font-weight: 400; font-size: .92rem; color: rgba(255, 255, 255, .8); }
.campaign h2, .campaign h3 { font-size: clamp(1.7rem, 3.6vw, 2.8rem); line-height: 1.15; }
.campaign p { color: rgba(255, 255, 255, .86); }
.campaign .btn { margin-top: 8px; }

/* ป้ายตามเมาส์บนราว */
.pointer { position: fixed; left: 0; top: 0; z-index: 30; margin: 18px 0 0 18px; padding: 5px 12px; border-radius: 999px; background: var(--orange); color: var(--ink); font-weight: 500; font-size: .82rem; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.pointer.on { opacity: 1; }

/* ตัวหนังสือยักษ์เลื่อนตามการสกรอลล์ */
.bigtype { overflow: hidden; background: var(--paper); padding-block: 34px 0; }
.bigtype div { width: max-content; font-family: var(--num); font-size: clamp(4.5rem, 13vw, 11rem); line-height: .95; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.bigtype i { font-style: normal; font-size: .35em; vertical-align: middle; color: var(--orange); -webkit-text-stroke: 0; padding-inline: .5em; }

/* ป้ายอ่านค่าของชิ้นที่หยิบ */
.readout { position: relative; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; margin-top: 8px; padding: 22px 26px; border: 1px solid var(--dark-line); border-radius: 6px; background: rgba(21, 21, 21, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); min-height: 150px; }
.readout::before, .readout::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--orange); }
.readout::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.readout::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.readout > * { animation: rise .4s var(--ease) both; }
.readout > :nth-child(2) { animation-delay: .05s; } .readout > :nth-child(3) { animation-delay: .1s; }
.ro-id { display: grid; justify-items: start; }
.ro-id .n { font-family: var(--num); font-size: 4.6rem; line-height: .85; color: var(--orange); }
.ro-id .en { font-family: var(--num); font-size: 1.15rem; letter-spacing: .06em; color: var(--on-dark-2); white-space: nowrap; }
.ro-main h2 { font-size: 1.5rem; }
.ro-main p { color: var(--on-dark-2); max-width: 60ch; }
.ro-buy { display: grid; gap: 8px; justify-items: end; }
.ro-buy .price { font-size: 2.2rem; }
.ro-buy .link { color: var(--on-dark); }
.ro-buy .ro-ch { font-weight: 400; font-size: .92rem; color: var(--on-dark-2); }
.ro-main .ro-note { font-size: .86rem; margin-top: 6px; }
@keyframes rise { from { opacity: .3; transform: translateY(10px); } }

/* แถบข้อความวิ่ง */
.ticker { background: var(--orange); color: var(--ink); overflow: hidden; margin-top: 40px; }
.ticker .run { display: flex; width: max-content; animation: tick 46s linear infinite; }
.ticker .run > div { display: flex; align-items: center; flex: none; padding-block: 8px 6px; }
.ticker:hover .run { animation-play-state: paused; }
.ticker span { font-family: var(--num); font-size: 1.2rem; letter-spacing: .07em; line-height: 1.2; white-space: nowrap; padding-inline: 20px; }
.ticker i { font-style: normal; font-size: .8rem; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ปุ่มหลัก: แสงวิ่งผ่านเมื่อชี้ */
.btn { position: relative; overflow: hidden; }
.btn:not(.ghost):not(:disabled)::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-18deg); transition: left .55s var(--ease); pointer-events: none; }
.btn:not(.ghost):not(:disabled):hover::after { left: 120%; }

/* โครงส่วนเนื้อหา */
section.block { padding-block: 72px; }
section.block.tight { padding-top: 0; }
section.block.white { background: var(--card); border-block: 1px solid var(--line); }
.head { display: grid; gap: 10px; margin-bottom: 32px; max-width: 62ch; }
.head h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); }
.head p { color: var(--ink-2); }

/* คลาสนี้ทำมาเพื่อ */
.for { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.for div { padding: 20px 0; border-top: 1px solid var(--line); }
.for b { display: block; font-size: 1.15rem; }
.for span { color: var(--ink-2); }
.forgrid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.forgrid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }
.forgrid .for { grid-template-columns: minmax(0, 1fr); }
.forgrid .for div:last-child { border-bottom: 1px solid var(--line); }

/* ไลน์ชีตบทเรียน */
.sheet { border-top: 2px solid var(--ink); }
.row { display: grid; grid-template-columns: 250px minmax(0, 1fr) 190px; gap: 30px; padding: 30px 0; border-bottom: 1px solid var(--line); align-items: start; }
.row .thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; background: #e4e4e8; }
.row .tag { display: flex; align-items: baseline; gap: 12px; }
.row .tag .n { font-family: var(--num); font-size: 2.6rem; line-height: .9; color: var(--orange); }
.row .tag .en { font-family: var(--num); font-size: 1.3rem; letter-spacing: .05em; color: var(--grey); }
.row h3 { font-size: 1.5rem; margin: 6px 0 6px; }
.row h3 a { text-decoration: none; }
.row h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.row .sum { color: var(--ink-2); max-width: 56ch; }
.spec { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 18px; margin-top: 14px; font-size: .95rem; }
.spec dt { color: var(--grey); font-weight: 400; }
.spec dd { color: var(--ink); font-weight: 400; }
.row .side { display: grid; gap: 12px; justify-items: start; }
.row .side .btn { width: 100%; }

/* แพ็กรวม */
.bundle { background: var(--orange); color: var(--ink); border-radius: 6px; padding: 30px 34px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; margin-top: 36px; }
.bundle h2 { font-size: 1.8rem; }
.bundle p { font-weight: 400; }
.bundle .buy { display: grid; gap: 12px; justify-items: end; }
.bundle .strike { text-decoration: line-through; font-weight: 400; margin-right: 10px; }
.bundle .price { font-size: 2.8rem; }

/* ตัวอย่างงาน */
.brands { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.brands figure, .gal figure { display: grid; gap: 6px; }
.brands img, .gal img, .dirs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: #fff; }
.gal { align-items: start; }
.gal img { aspect-ratio: auto; height: auto; }
.brands figcaption, .gal figcaption, .dirs figcaption { font-size: .9rem; font-weight: 400; line-height: 1.35; }
.brands figcaption span, .dirs figcaption span { display: block; color: var(--grey); font-weight: 300; }
.dirs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.dirs img { aspect-ratio: 3 / 2; object-fit: contain; }
.sub { font-size: 1.25rem; margin: 44px 0 16px; }
.sub:first-of-type { margin-top: 0; }
.note { color: var(--grey); font-size: .9rem; margin-top: 14px; }

/* ตรวจงาน AI */
.proof { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 44px; align-items: center; }
.proof .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.proof figure { display: grid; gap: 8px; }
.proof img { border-radius: 4px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.proof figcaption { font-size: .92rem; font-weight: 400; }
.proof .bad { color: var(--err); }
.proof .good { color: var(--ok); }
.checks { display: grid; gap: 6px; margin-top: 16px; padding-left: 1.2em; color: var(--ink-2); }

/* ขั้นตอนการเรียน */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 14px; }
.steps li::before { content: "0" counter(step); font-family: var(--num); font-size: 2.4rem; line-height: 1; color: var(--orange); display: block; }
.steps b { display: block; font-size: 1.15rem; margin: 6px 0 2px; }
.steps span { color: var(--ink-2); }

/* ตาราง */
.tablebox { overflow-x: auto; border-top: 2px solid var(--ink); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .97rem; }
th, td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 400; color: var(--grey); font-size: .9rem; }
td.n { font-family: var(--num); font-size: 1.3rem; color: var(--orange); width: 3rem; }
td code { font-family: inherit; font-weight: 400; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 1px 8px; margin-right: 6px; white-space: nowrap; display: inline-block; }

/* ผู้สอน */
.teacher-card { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; }
.teacher-card h3 { font-size: 1.6rem; }
.teacher-card .role { color: var(--ink-2); margin-bottom: 14px; }

/* ช่องรอข้อมูลจากเจ้าของคอร์ส (ต้องเติมหรือลบก่อนเปิดขายจริง) */
.todo { border: 1.5px dashed var(--orange); background: var(--orange-soft); color: #7a2a0c; border-radius: 6px; padding: 12px 16px; font-size: .92rem; font-weight: 400; }
.todo::before { content: "รอข้อมูล: "; font-weight: 500; }
.todo.photo { aspect-ratio: 4 / 5; display: flex; flex-wrap: wrap; gap: 4px; align-content: center; justify-content: center; text-align: center; }

/* คำถามที่พบบ่อย */
.faq { display: grid; gap: 0; max-width: 780px; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { font-weight: 500; font-size: 1.08rem; cursor: pointer; }
.faq details p, .faq details .todo { margin-top: 10px; color: var(--ink-2); max-width: 64ch; }
.faq details .todo { color: #7a2a0c; }

/* ปิดท้าย + ส่วนท้าย */
.closing { background: var(--dark); color: var(--on-dark); padding-block: 64px; }
.closing .wrap { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: center; }
.closing .kit { width: 100%; border-radius: 6px; }
.closing h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.closing p { color: var(--on-dark-2); margin-top: 8px; }
.closing .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
footer { background: var(--dark); color: var(--on-dark-2); border-top: 1px solid var(--dark-line); padding-block: 28px 36px; font-size: .92rem; }
footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
footer b { color: var(--on-dark); display: block; }
footer .flogo { height: 60px; width: auto; margin-bottom: 14px; }
footer .todo { margin-top: 6px; }

/* หน้ารายละเอียดบท */
.chead { color: var(--on-dark); }
.chead > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.chead .back { color: var(--on-dark-2); font-size: .93rem; font-weight: 400; }
.chead .tag-id { display: flex; align-items: baseline; gap: 14px; margin-top: 18px; }
.chead .tag-id .n { font-family: var(--num); font-size: 5.4rem; line-height: .85; color: var(--orange); }
.chead .tag-id .en { font-family: var(--num); font-size: 1.9rem; letter-spacing: .05em; color: var(--on-dark-2); }
.chead h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin: 10px 0 12px; }
.chead .sum { color: var(--on-dark-2); max-width: 50ch; }
.chead .buyline { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
.chead .buyline .price { font-size: 3rem; }
.variant { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 26px; padding: 5px; border: 1px solid var(--dark-line); border-radius: 8px; background: rgba(21, 21, 21, .6); }
.variant button { display: grid; gap: 0; justify-items: start; font: inherit; font-weight: 400; font-size: .92rem; color: var(--on-dark-2); background: none; border: 0; border-radius: 5px; padding: 8px 18px 6px; cursor: pointer; transition: background .3s ease, color .3s ease; }
.variant button b { font-family: var(--num); font-weight: 400; font-size: 1.5rem; line-height: 1; letter-spacing: .03em; color: var(--on-dark); }
.variant button:hover { color: var(--on-dark); }
.variant button[aria-checked="true"] { background: var(--orange); color: var(--ink); }
.variant button[aria-checked="true"] b { color: var(--ink); }
.vnote { margin-top: 10px; color: var(--on-dark-2); font-size: .93rem; }

/* ชิ้นงานแขวนเดี่ยว: เอียงตามเมาส์ และพลิกเมื่อเปลี่ยนแบบที่ซื้อ */
.solo { position: relative; perspective: 1200px; padding-bottom: 26px; }
.solo .rail { top: 8px; }
.hang3d { width: min(100%, 460px); margin-inline: auto; transform-style: preserve-3d; transform-origin: 50% 0; transform: rotateY(var(--ty, 0deg)) rotateX(var(--tx, 0deg)); transition: transform .5s var(--ease); }
.hang3d .sway { animation: settle 1.2s var(--ease) 1, sway 6s ease-in-out 1.2s infinite; --i: 0; }
.hook { display: block; width: 40px; height: auto; margin: 0 auto -2px; fill: none; stroke: #dedee4; stroke-width: 2.4; stroke-linecap: round; }
.bar { position: relative; z-index: 2; display: block; height: 6px; border-radius: 3px; background: linear-gradient(#fafafc, #9a9aa3 55%, #4a4a51); }
.bar::before, .bar::after { content: ""; position: absolute; top: 3px; width: 14px; height: 24px; border-radius: 2px; background: linear-gradient(90deg, #8f8f98, #e9e9ee 45%, #8f8f98); box-shadow: 0 4px 8px rgba(0, 0, 0, .45); }
.bar::before { left: 12%; } .bar::after { right: 12%; }
.flip { position: relative; margin-top: 9px; aspect-ratio: 3 / 2; transform-style: preserve-3d; transition: transform 1s var(--ease); }
.flip.turned { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: 0 0 0 2px var(--orange), 0 40px 80px -30px rgba(239, 78, 22, .55); }
.face.b { transform: rotateY(180deg); }
.solo .htag { right: -4%; top: 34%; font-size: 1.9rem; min-width: 76px; padding: 20px 12px 8px; }
.cgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
.lessonlist { list-style: none; padding: 0; border-top: 2px solid var(--ink); }
.lessonlist li { padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 400; display: flex; justify-content: space-between; gap: 12px; }
.lessonlist li span { color: var(--grey); font-weight: 300; font-size: .9rem; white-space: nowrap; }
.aside { position: sticky; top: 84px; display: grid; gap: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 24px; }
.aside h3 { font-size: 1rem; font-weight: 400; color: var(--grey); margin-bottom: 4px; }
.aside .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aside .chips span { border: 1px solid var(--line); border-radius: 4px; padding: 2px 10px; font-size: .92rem; font-weight: 400; }
.gal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 2px solid var(--ink); padding-top: 18px; margin-top: 56px; font-weight: 400; }
.pager a { text-underline-offset: 4px; }

/* ฟอร์มและกล่อง */
.page { padding-block: 44px 72px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 30px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.form-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
label { font-weight: 400; font-size: .97rem; }
input[type="email"], input[type="password"] { width: 100%; font: inherit; font-weight: 400; padding: 12px 14px; border: 1px solid #c3c3cb; border-radius: 6px; background: #fff; color: var(--ink); }
.msg { border-radius: 6px; padding: 12px 14px; font-size: .96rem; font-weight: 400; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.err { background: var(--err-soft); color: var(--err); }
.eyebrow { font-weight: 400; font-size: .93rem; color: var(--orange-text); }

/* หน้าจ่ายเงิน: ป้ายราคาแขวน 3 มิติ */
.paystage { min-height: calc(100vh - 60px); background: radial-gradient(70% 50% at 50% 30%, #34343b 0%, #1e1e22 50%, var(--dark) 85%); }
.tagwrap { position: relative; perspective: 1100px; padding-top: 70px; }
.tagwrap::before { content: ""; position: absolute; left: 50%; top: -44px; width: 1px; height: 136px; background: #dedee4; }
.paytag { position: relative; border: 0; border-radius: 6px; padding: 64px 34px 34px; clip-path: polygon(40px 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 0 100%, 0 40px); transform-origin: 50% -70px; transform: rotateY(var(--ty, 0deg)) rotateX(var(--tx, 0deg)); transition: transform .5s var(--ease); animation: tagdrop 1.3s var(--ease) both; }
.paytag::before { content: ""; position: absolute; left: 50%; top: 20px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #26262a; box-shadow: 0 0 0 4px var(--orange); }
.paytag h1 { font-size: 1.6rem; }
.paytag .price { font-size: 4.4rem; color: var(--ink); }
.paytag .price small { font-size: 1.1rem; }
.paytag .tear { border-top: 2px dashed #c3c3cb; margin: 6px -34px; }
@keyframes tagdrop { 0% { opacity: 0; transform: translateY(-60px) rotateZ(-9deg); } 40% { opacity: 1; transform: translateY(0) rotateZ(5deg); } 70% { transform: rotateZ(-2.5deg); } 100% { transform: rotateZ(0); } }

/* คอร์สของฉัน */
.mycourses { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.ch { background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.ch img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; background: #e4e4e8; }
.ch .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ch .no { font-family: var(--num); font-size: 1.15rem; letter-spacing: .05em; color: var(--orange-text); }
.ch h3 { font-size: 1.2rem; }
.ch .buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.ch .price { font-size: 1.6rem; }
.ch.locked img { filter: grayscale(1); opacity: .7; }

/* หน้าเรียน */
.learn { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 24px; align-items: start; }
.lessons { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: grid; gap: 2px; }
.lessons button { text-align: left; font: inherit; font-weight: 400; font-size: .95rem; line-height: 1.4; background: none; border: 0; border-radius: 4px; padding: 9px 12px; cursor: pointer; color: var(--ink-2); }
.lessons button:hover { background: var(--paper); }
.lessons button.on { background: var(--ink); color: #fff; }
.player { background: var(--dark); border-radius: 6px; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center; color: var(--on-dark-2); text-align: center; padding: 16px; }
.player iframe { width: 100%; height: 100%; border: 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* รายการบท: ภาพขยับเมื่อชี้ */
.row .thumb { display: block; overflow: hidden; border-radius: 4px; }
.row .thumb img { transition: transform .6s var(--ease); }
.row:hover .thumb img { transform: scale(1.07) rotate(-1.2deg); }
.row .tag .n { transition: transform .4s var(--ease); display: inline-block; }
.row:hover .tag .n { transform: translateX(6px); }

/* ลูกเล่นตามการสกรอลล์ (ทำงานเฉพาะเบราว์เซอร์ที่รองรับ ที่เหลือแสดงแบบนิ่ง) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .top::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; background: var(--orange); transform-origin: 0 50%; animation: grow linear both; animation-timeline: scroll(root); }
    .bigtype div { animation: slide linear both; animation-timeline: view(); }
    section.block .head h2, .closing h2 { animation: lift linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    .row { animation: lift linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    .brands figure, .dirs figure { animation: pop linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  }
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slide { from { transform: translateX(4vw); } to { transform: translateX(-38%); } }
@keyframes lift { from { opacity: .25; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: .2; transform: scale(.9) rotate(-2deg); } to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
  .pitch, .proof, .chead > .wrap, .cgrid, .teacher-card, .closing .wrap, .forgrid, .learn { grid-template-columns: minmax(0, 1fr); }
  .forgrid, .closing .wrap { gap: 28px; }
  .pitch { align-items: start; gap: 22px; }
  .rack { overflow-x: auto; overflow-y: hidden; margin-inline: -18px; padding: 0 18px 26px; scrollbar-width: none; }
  .rack::-webkit-scrollbar { display: none; }
  .rack-hint { position: sticky; left: 0; }
  .rackbody { width: max-content; min-width: 100%; }
  .pieces { --w: 130px; --slot: .34; justify-content: flex-start; padding-inline: 10px; }
  .floor { left: 0; right: 0; }
  .forgrid img { aspect-ratio: 3 / 2; object-position: 50% 38%; }
  .row { grid-template-columns: 180px minmax(0, 1fr); }
  .row .side { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; align-items: center; }
  .row .side .btn { width: auto; }
  .aside { position: static; }
  .brands, .dirs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .teacher-card .todo.photo { max-width: 260px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  section.block { padding-block: 52px; }
  .showroom { padding-top: 30px; }
  .campaign figure { height: 78vh; }
  .campaign img { object-position: 78% 50%; }
  .campaign figure::after { background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent 60%); }
  .pitch { gap: 18px; }
  .hero .org img { height: 54px; }
  .rack { margin-top: 30px; }
  .pieces { --w: 118px; }
  .piece.on { flex-basis: calc(var(--w) * 1.2); }
  .sway .no { font-size: 1.9rem; }
  .htag { right: -22%; font-size: 1.2rem; min-width: 46px; }
  .readout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px; }
  .ro-id { display: flex; align-items: baseline; gap: 12px; }
  .ro-id .n { font-size: 3.4rem; }
  .ro-buy { grid-template-columns: auto 1fr; align-items: center; justify-items: start; gap: 10px 16px; }
  .ro-buy .btn { justify-self: end; }
  .ro-buy .link { grid-column: 1 / -1; }
  .ticker { margin-top: 28px; }
  .brand { font-size: 1.15rem; }
  .nav a, .nav button { padding: 6px 7px; font-size: .84rem; }
  .for, .steps, .bundle { grid-template-columns: minmax(0, 1fr); }
  .bundle { padding: 24px 22px; }
  .bundle .buy { justify-items: start; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .row .side { grid-template-columns: 1fr auto; }
  .row .side .link { grid-column: 1 / -1; }
  .brands, .dirs, .gal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chead .tag-id .n { font-size: 4rem; }
  .chead > .wrap { gap: 40px; }
  .solo .htag { right: 0; }
  .paytag { padding-inline: 22px; } .paytag .tear { margin-inline: -22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motes { display: none; }
  .campaign figure { position: relative; top: auto; }
  .sway, .piece.on .sway, .htag, .hang3d .sway, .paytag, .ticker .run, .readout > * { animation: none; }
  .hang, .piece, .pieces, .htag, .hang3d, .flip, .sway .no, .btn::after { transition: none; }
  .ticker { overflow-x: auto; }
}
