/* อะเบาท์ พี อะคาเดมี่ — ธีม "เวทีแสงทอง" ดำ ทองแชมเปญ ตามบรีฟ
   ไฟเวทีส่าย ละอองทอง ตัวหนังสือทองเล่นแสง การ์ดเรืองตามเมาส์ แถบตัวหนังสือวิ่ง
   ลูกเล่นทุกอย่างปิดเองเมื่อผู้ใช้ตั้งลดการเคลื่อนไหว และในโหมดแก้หน้าเว็บ (?edit=1)
   กฎเหล็ก: ทุกส่วนต้องยังสวยเมื่อลูกค้าใส่ข้อความสั้นมากหรือยาวมาก และต้องไม่ล้นจอที่ 360px */

:root {
  --accent: #c9a961;
  --gold-hi: #f0e3b4;
  --gold-lo: #94742f;
  --accent-ink: #0b0a08;
  --ink: #f4efe4;
  --muted: #b5ae9f;
  --paper: #0b0a08;
  --paper-2: #13110c;
  --line: rgba(240, 227, 180, .16);
  --glass: rgba(240, 227, 180, .045);
  --radius: 16px;
  --font: 'Anuphan', 'Noto Sans Thai', -apple-system, 'Segoe UI', sans-serif;
  --display: var(--font);
  --gap: clamp(72px, 10vw, 148px);
  --pad: clamp(20px, 5vw, 64px);
  --max: 1320px;
  --nav: 76px;
  --ease: cubic-bezier(.2, .75, .2, 1);
  --gold-text: linear-gradient(105deg, #a9853f 0%, #e6d092 22%, #fff6d8 42%, #d4b56d 58%, #e6d092 78%, #a9853f 100%);
  --gold-fill: linear-gradient(115deg, #a9853f 0%, #ecd798 42%, #c9a961 70%, #f0e3b4 100%);
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; background: var(--paper); }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper);
  font-size: 17px; line-height: 1.75; font-weight: 400; -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
/* เกรนฟิล์มบางๆ ทั้งหน้า ให้พื้นดำดูมีเนื้อ */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, video { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
/* ห้าม text-wrap: balance กับไทย จะตัดกลางคำ (เส้น/ทาง) */
h1, h2, h3 { font-family: var(--display); line-height: 1.45; margin: 0; font-weight: 600; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }
.sec { padding-block: var(--gap); position: relative; }
.sec-alt { background: radial-gradient(60% 50% at 85% 0%, rgba(201,169,97,.09), transparent 70%), radial-gradient(50% 45% at 5% 100%, rgba(201,169,97,.06), transparent 70%), var(--paper-2); }
.sec-alt::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240,227,180,.5), transparent);
}
main > :first-child:not(.hero) { padding-top: calc(var(--gap) + var(--nav)); }

/* ---------- หัวข้อ ---------- */
.sec-head { max-width: 980px; margin-bottom: clamp(36px, 5vw, 68px); }
.sec-head h2, .about-text h2 { font-size: clamp(28px, 4.4vw + 12px, 60px); font-weight: 600; line-height: 1.42; }
.sec-head h2::before, .about-text h2::before {
  content: ''; display: block; width: 72px; height: 2px; margin-bottom: 24px;
  background: var(--gold-fill); transform-origin: left;
}
.reveal .sec-head h2::before, .sec-head.reveal h2::before, .about-text.reveal h2::before { transform: scaleX(0); transition: transform .9s var(--ease) .15s; }
.sec-head.reveal.in h2::before, .about-text.reveal.in h2::before { transform: none; }
.sec-head p { color: var(--muted); margin: 18px 0 0; font-size: 17px; }
.sec-more { margin-top: clamp(32px, 4vw, 48px); }

/* ตัวหนังสือทองเล่นแสง — ไล่สีบนแต่ละคำ เพราะ background-clip บนตัวแม่จะหายเมื่อลูกขยับ */
.hero-title, .cta-band h2, .sec-head h2, .about-text h2 {
  background: var(--gold-text) 0 0 / 900px auto; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: shimmer 9s linear infinite;
  padding-block: .1em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.split { background: none !important; animation: none !important; }
.split .w {
  display: inline-block; max-width: 100%; padding-block: .1em;
  background: var(--gold-text) 0 0 / 900px auto; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: shimmer 9s linear infinite;
  opacity: 0; translate: 0 .55em; filter: blur(10px);
  transition: opacity .8s var(--ease), translate .8s var(--ease), filter .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms + 80ms);
}
.in .w, .split.in .w, .hero-slide.on .w { opacity: 1; translate: 0 0; filter: blur(0); }
.has-intro .hero-slide.on .w { transition-delay: calc(var(--i, 0) * 80ms + 1.05s); }
@keyframes shimmer { to { background-position: -900px 0; } }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; overflow: hidden; isolation: isolate;
  padding: 13px 32px; min-height: 52px; border-radius: 999px;
  font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap;
  background: var(--gold-fill) 0 0 / 420px auto; color: var(--accent-ink); border: 1px solid transparent;
  box-shadow: 0 0 0 0 rgba(240,227,180,.0), 0 10px 34px -12px rgba(201,169,97,.65);
  transition: background-position .5s var(--ease), box-shadow .3s ease, translate .3s var(--ease), color .2s ease, border-color .2s ease;
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent);
  transform: translateX(-160%) skewX(-18deg);
}
.btn:hover { background-position: 100% 0; box-shadow: 0 0 0 4px rgba(240,227,180,.14), 0 16px 44px -10px rgba(201,169,97,.85); }
.btn:hover::before { transform: translateX(340%) skewX(-18deg); transition: transform .85s var(--ease); }
.btn:active { scale: .97; }
.btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.6; flex: none; }
.btn-ghost {
  background: var(--glass); color: var(--gold-hi); border-color: rgba(240,227,180,.32); box-shadow: none;
}
.btn-ghost:hover { color: var(--accent-ink); background: var(--gold-fill) 100% 0 / 420px auto; border-color: transparent; }
.btn-light { color: var(--accent-ink); }

/* ---------- เนื้อหาปรากฏตอนเลื่อนถึง (ใช้ translate/scale แยก เพื่อให้ transform เหลือไว้ใช้ตอนเอียงการ์ด) ---------- */
.reveal { opacity: 0; translate: 0 24px; transition: opacity .6s ease, translate .7s var(--ease); }
.reveal.in { opacity: 1; translate: 0 0; }
.reveal-clip { clip-path: inset(14% 8% 14% 8% round 18px); opacity: 0; scale: 1.04; transition: clip-path 1s var(--ease), opacity .6s ease, scale 1.1s var(--ease); }
.reveal-clip.in { clip-path: inset(0 0 0 0 round var(--clip-r, 14px)); opacity: 1; scale: 1; }

/* ---------- ม่านเปิดตอนเข้าเว็บครั้งแรก ---------- */
.intro { display: none; }
.has-intro .intro {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  animation: introOut .1s linear 1.5s forwards;
}
.intro i { position: absolute; left: 0; right: 0; height: 50.5%; background: #070604; animation: curtain .75s var(--ease) .75s forwards; }
.intro i:first-child { top: 0; border-bottom: 1px solid rgba(240,227,180,.5); }
.intro i:nth-child(2) { bottom: 0; --dir: 1; animation-name: curtain2; }
.intro img { position: relative; width: min(220px, 56vw); animation: introLogo .95s var(--ease) forwards; }
@keyframes curtain { to { transform: translateY(-101%); } }
@keyframes curtain2 { to { transform: translateY(101%); } }
@keyframes introLogo { 0% { opacity: 0; scale: .92; filter: blur(8px); } 45%, 75% { opacity: 1; scale: 1; filter: blur(0); } 100% { opacity: 0; scale: 1.05; } }
@keyframes introOut { to { visibility: hidden; } }

/* ---------- แถบความคืบหน้าการเลื่อน ---------- */
.scroll-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none;
  background: var(--gold-fill); transform: scaleX(0); transform-origin: left;
  box-shadow: 0 0 12px rgba(240,227,180,.8);
}
body.nav-open .scroll-bar { display: none; }

/* ---------- เคอร์เซอร์ทอง (เฉพาะจอที่มีเมาส์) ---------- */
.cursor-ring, .cursor-spot { position: fixed; top: 0; left: 0; pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.cursor-on .cursor-ring, .cursor-on .cursor-spot { opacity: 1; }
.cursor-spot {
  z-index: 1; width: 720px; height: 720px; margin: -360px 0 0 -360px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(201,169,97,.11), transparent);
}
.cursor-ring { z-index: 80; display: block; }
.cursor-ring span {
  display: grid; place-items: center; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 1px solid rgba(240,227,180,.75); color: var(--accent-ink); font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), background .25s ease, border-color .25s ease;
}
.cursor-ring.big span { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: rgba(240,227,180,.12); }
.cursor-ring.label span { width: 78px; height: 78px; margin: -39px 0 0 -39px; background: var(--gold-hi); border-color: transparent; }
main, .foot { position: relative; z-index: 2; }
main > *, .foot { background-clip: padding-box; }

/* ---------- ไฟเวที ---------- */
.lights { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; mix-blend-mode: screen; translate: calc(var(--lx, 0) * -22px) 0; transition: translate .6s var(--ease); }
.lights i {
  position: absolute; top: -8%; width: clamp(180px, 28vw, 460px); height: 118%; transform-origin: 50% 0;
  filter: blur(22px); opacity: .62;
  animation: sway 11s ease-in-out infinite alternate;
}
/* ตัดทรงที่ตัวลูก เพราะ filter บนตัวเดียวกันจะเบลอก่อนตัด ขอบแสงจะคม */
.lights i::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(240,227,180,.62), rgba(201,169,97,.16) 50%, transparent 82%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
}
.lights i:nth-child(1) { left: 2%; --from: -8deg; --to: 26deg; }
.lights i:nth-child(2) { left: 26%; --from: 14deg; --to: -18deg; animation-duration: 14s; opacity: .42; }
.lights i:nth-child(3) { right: 26%; --from: -16deg; --to: 18deg; animation-duration: 12s; opacity: .42; }
.lights i:nth-child(4) { right: 2%; --from: 8deg; --to: -26deg; animation-duration: 16s; }
@keyframes sway { from { transform: rotate(var(--from)); } to { transform: rotate(var(--to)); } }

/* ---------- แบนเนอร์หน้าแรก: ชื่อโตกลางจอ ภาพเอียงแล้วตั้งตรงเมื่อเลื่อน ---------- */
.hero { position: relative; background: var(--paper); overflow: hidden; }
.hero-track { display: grid; position: relative; z-index: 2; }
.hero-slide {
  grid-area: 1 / 1; opacity: 0; visibility: hidden; position: relative; isolation: isolate;
  transition: opacity .9s ease, visibility .9s;
  display: flex; flex-direction: column;
}
.hero-slide.on { opacity: 1; visibility: visible; }
.hero-glow {
  position: absolute; inset: -12%; z-index: -1; background-size: cover; background-position: center;
  filter: blur(70px) brightness(.4) saturate(1.15);
}
.hero-media { position: relative; overflow: hidden; background: #000; }
.hero-bg {
  position: absolute; inset: -40px; background-size: cover; background-position: center;
  filter: blur(36px) brightness(.5);
}
.hero-media picture { position: absolute; inset: 0; display: block; }
.hero-media img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.hero-title { margin: 0; line-height: 1.42; text-wrap: pretty; }
.hero-sub { margin: 10px 0 0; color: var(--ink); opacity: .86; font-size: clamp(16px, 1.5vw, 20px); }

.hero-full .hero-slide { align-items: center; padding: calc(var(--nav) + clamp(24px, 6vh, 64px)) var(--pad) clamp(64px, 8vw, 96px); }
.hero-full .hero-body {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(20px, 2.6vw, 30px);
  max-width: 1000px; flex: 1 1 auto; justify-content: center; margin-bottom: clamp(30px, 5vh, 56px);
  opacity: calc(1 - var(--z, 0) * 1.3); translate: 0 calc(var(--z, 0) * -46px);
}
.hero-full .hero-title { font-size: clamp(34px, 4.2vw + 18px, 64px); font-weight: 700; }
.hero-full .hero-media {
  width: min(1180px, 100%); aspect-ratio: 1600 / 862; flex: none; border-radius: clamp(12px, 1.6vw, 22px);
  box-shadow: 0 0 0 1px rgba(240,227,180,.32), 0 30px 110px -18px rgba(201,169,97,.5);
  transform-origin: 50% 0;
  transform: perspective(1500px) rotateX(calc(var(--tx, 0deg) + (1 - var(--z, 1)) * 15deg)) rotateY(var(--ty, 0deg)) scale(calc(.87 + var(--z, 1) * .13));
  transition: transform .35s ease-out;
}
/* แสงเงาวิ่งผ่านภาพ */
.hero-full .hero-media::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,246,216,.2) 50%, transparent 62%);
  transform: translateX(-100%); animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0%, 58% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.hero-full::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--paper));
}
.dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }

.hero-dots { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 5; display: flex; justify-content: center; }
.hero-dots button {
  width: 56px; height: 44px; border: 0; padding: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.hero-dots button::before {
  content: ''; display: block; width: 42px; height: 2px; background: rgba(240,227,180,.25);
  background-image: linear-gradient(var(--gold-hi), var(--gold-hi)); background-repeat: no-repeat; background-size: 0 100%;
}
.hero-dots button[aria-current="true"]::before { animation: dotFill var(--secs, 6s) linear both; }
.stopped .hero-dots button[aria-current="true"]::before { animation: none; background-size: 100% 100%; }
@keyframes dotFill { to { background-size: 100% 100%; } }

/* หน้ารอง: เลขหน้าตัวโตจางๆ ชื่อหน้าซ้าย รูปทรงซุ้มเวทีขวา */
.hero-compact { border-bottom: 1px solid var(--line); }
.hero-compact .hero-slide, .hero-split .hero-slide { padding-top: var(--nav); }
.hero-compact .hero-glow { filter: blur(70px) brightness(.3) sepia(.75) saturate(1.5); }
.hero-compact .hero-media, .hero-split .hero-media {
  width: calc(100% - 2 * var(--pad)); margin: 0 auto var(--pad); aspect-ratio: 1 / 1; border-radius: 999px 999px 18px 18px;
  box-shadow: 0 0 0 1px rgba(240,227,180,.45), 0 0 90px -10px rgba(201,169,97,.5);
  animation: archIn 1.2s var(--ease) both;
}
.has-intro .hero-compact .hero-media { animation-delay: .9s; }
@keyframes archIn { from { clip-path: inset(100% 0 0 0 round 999px 999px 18px 18px); opacity: 0; } to { clip-path: inset(0 0 0 0 round 999px 999px 18px 18px); opacity: 1; } }
.hero-compact .hero-media img, .hero-split .hero-media img { object-fit: cover; }
.hero-compact .hero-bg, .hero-split .hero-bg { display: none; }
.hero-compact .hero-body, .hero-split .hero-body {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 24px;
  padding: clamp(40px, 6vw, 80px) var(--pad);
}
.hero-body[data-ghost]::before {
  content: attr(data-ghost); position: absolute; z-index: -1; left: calc(var(--pad) - .04em); top: 50%; translate: 0 -54%;
  font-size: clamp(150px, 26vw, 400px); font-weight: 700; line-height: 1; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1px rgba(240,227,180,.17); pointer-events: none;
}
.hero-compact .hero-copy, .hero-split .hero-copy { width: 100%; }
.hero-compact .hero-title, .hero-split .hero-title { font-size: clamp(34px, 4.2vw + 18px, 64px); font-weight: 700; }
.hero-compact .lights i:nth-child(2), .hero-compact .lights i:nth-child(3) { display: none; }

/* ---------- แถบตัวหนังสือวิ่ง ---------- */
.marquee {
  position: relative; z-index: 2; overflow: hidden; padding-block: clamp(16px, 2.2vw, 30px); background: var(--paper);
  border-block: 1px solid var(--line);
}
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee-run { display: flex; align-items: center; flex: none; }
.marquee span {
  flex: none; padding-inline: clamp(18px, 2.4vw, 36px); line-height: 1.4; white-space: nowrap;
  font-size: clamp(34px, 6vw, 92px); font-weight: 700;
  color: transparent; -webkit-text-stroke: 1px rgba(240,227,180,.62);
}
.marquee span:nth-of-type(even) { color: var(--accent); -webkit-text-stroke: 0; }
.marquee i { flex: none; width: 14px; height: 14px; rotate: 45deg; background: var(--gold-fill); }
.marquee-rev { background: var(--gold-fill); border: 0; }
.marquee-rev .marquee-track { animation-direction: reverse; }
.marquee-rev span, .marquee-rev span:nth-of-type(even) { color: var(--accent-ink); -webkit-text-stroke: 0; }
.marquee-rev i { background: var(--accent-ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- จุดเด่น: การ์ดกระจก เส้นขอบเรืองตามเมาส์ ---------- */
.features-grid { display: grid; gap: 12px; }
.feature, .contact-side {
  --mx: 50%; --my: 0%;
  position: relative; border-radius: var(--radius); background: linear-gradient(160deg, rgba(240,227,180,.075), rgba(240,227,180,.015) 60%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.feature::before, .contact-side::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx) var(--my), var(--gold-hi), rgba(201,169,97,.25) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s ease;
}
.feature::after, .contact-side::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(280px circle at var(--mx) var(--my), rgba(201,169,97,.14), transparent 70%);
  opacity: 0; transition: opacity .3s ease;
}
.feature:hover::before, .feature:hover::after, .contact-side:hover::before, .contact-side:hover::after { opacity: 1; }
.feature {
  padding: clamp(22px, 2.4vw, 34px); display: flex; flex-direction: column; gap: clamp(18px, 3vw, 44px); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s ease, opacity .6s ease, translate .7s var(--ease);
}
.feature:hover { transform: translateY(-4px); }
.feature-top { display: flex; align-items: flex-start; justify-content: space-between; }
.feature-num {
  font-size: clamp(46px, 5vw, 72px); font-weight: 700; line-height: 1; letter-spacing: -.02em;
  color: transparent; -webkit-text-stroke: 1px var(--accent); transition: color .3s ease;
}
.feature:hover .feature-num { color: var(--accent); }
.feature-icon {
  color: var(--gold-hi); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(240,227,180,.3); transition: rotate .5s var(--ease), background .3s ease, color .3s ease;
}
.feature:hover .feature-icon { background: var(--gold-hi); color: var(--accent-ink); rotate: 12deg; }
.feature-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.feature h3 { font-size: clamp(19px, 1.7vw, 23px); margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }

/* เส้นทางในหน้าโปรแกรม: เส้นทองวิ่งตามการเลื่อน จุดติดไฟทีละขั้น */
.timeline { position: relative; gap: 0; --p: 1; }
.timeline::before, .timeline::after { content: ''; position: absolute; left: 27px; top: 28px; bottom: calc(clamp(32px, 5vw, 56px) + 28px); width: 2px; background: var(--line); }
.timeline::after { background: var(--gold-fill); transform: scaleY(var(--p)); transform-origin: top; box-shadow: 0 0 14px rgba(240,227,180,.7); }
.timeline .feature {
  background: none; box-shadow: none; padding: 0 0 clamp(32px, 5vw, 56px) 80px; overflow: visible; z-index: 1;
  gap: 14px;
}
.timeline .feature:hover { transform: none; }
.timeline .feature::before, .timeline .feature::after { display: none; }
.timeline .feature-top { align-items: center; min-height: 0; }
.timeline .feature > :last-child { min-height: 56px; display: flex; flex-direction: column; justify-content: center; }
.timeline .feature-num {
  position: absolute; left: 0; top: 0; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font-size: 19px; letter-spacing: 0; -webkit-text-stroke: 0; color: var(--accent-ink); background: var(--gold-fill);
  box-shadow: 0 0 0 6px var(--paper), 0 0 30px rgba(240,227,180,.55);
  transition: background .4s ease, color .4s ease, box-shadow .4s ease, scale .4s var(--ease);
}
.tl-js .feature:not(.lit) .feature-num { background: var(--paper-2); color: var(--muted); box-shadow: 0 0 0 6px var(--paper), inset 0 0 0 1px var(--line); scale: .86; }
.timeline .feature-icon { display: none; }

/* ---------- เกี่ยวกับ ---------- */
.about { display: grid; gap: clamp(28px, 5vw, 88px); align-items: center; }
.about-text > h2 { margin-bottom: 26px; }
.about-text p { color: var(--muted); margin: 0 0 20px; white-space: pre-line; }
.about-text p.pull { color: var(--ink); font-size: clamp(18px, 1.2vw + 13px, 22px); font-weight: 600; line-height: 1.7; margin: 30px 0 24px; padding-left: 20px; border-left: 2px solid var(--accent); }
.about-text p[data-allow-en] { color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.about-text .btn { margin-top: 8px; }
.about-pic { position: relative; }
.about-pic img { width: 100%; border-radius: 14px; }
.spin-badge {
  position: absolute; right: 14px; bottom: 14px; width: clamp(84px, 8.5vw, 124px); aspect-ratio: 1;
  display: grid; place-items: center; border-radius: 50%; background: var(--paper);
  box-shadow: 0 0 0 1px rgba(240,227,180,.35); color: var(--gold-hi);
}
.spin-badge svg:first-child { position: absolute; inset: 6%; width: 88%; height: 88%; animation: spin 18s linear infinite; }
.spin-badge text { font-size: 12px; font-weight: 600; fill: var(--accent); letter-spacing: .06em; font-family: var(--font); }
.spin-badge > svg:last-child { width: 26%; height: 26%; stroke: currentColor; fill: none; stroke-width: 1.5; rotate: -45deg; }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- บริการ: เหลื่อมระดับ เอียงตามเมาส์ ---------- */
.cards { display: grid; gap: 10px; }
.card {
  display: flex; flex-direction: column; min-width: 0;
  transform: perspective(1000px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform .25s ease-out;
}
.card-pic { position: relative; overflow: hidden; border-radius: 14px; --clip-r: 14px; }
.card-pic img { width: 100%; transition: transform .9s var(--ease), filter .5s ease; }
.card:hover .card-pic img { transform: scale(1.05); filter: brightness(1.14) saturate(1.06); }
.card-pic::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,246,216,.28) 50%, transparent 65%); transform: translateX(-110%);
}
.card:hover .card-pic::after { transform: translateX(110%); transition: transform .95s var(--ease); }
.card-no {
  position: absolute; left: 14px; top: 8px; font-size: clamp(24px, 3vw, 40px); font-weight: 700; line-height: 1.4;
  color: transparent; -webkit-text-stroke: 1px var(--gold-hi);
}
.card-body { padding: 16px 0 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; align-items: flex-start; }
.card-body h3 { font-size: clamp(18px, 1.9vw, 27px); }
.card-body p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.card .btn { margin-top: 10px; width: 100%; }
.card-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: auto;
  color: var(--gold-hi); font-size: 15.5px; font-weight: 600; text-decoration: none;
}
.card-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; transition: translate .3s var(--ease); }
.card-link:hover svg { translate: 6px 0; }
.cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }

.rows { display: grid; }
.row-item {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.row-item h3 { font-size: 18px; }
.row-item p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- ห้องซ้อม ---------- */
.gal { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.gal figure { margin: 0; min-width: 0; position: relative; }
.gal a { display: block; overflow: hidden; border-radius: 12px; }
.gal img { width: 100%; transition: transform .9s var(--ease), filter .5s ease; }
.gal a:hover img { transform: scale(1.05); filter: brightness(1.12); }
.gal figcaption { padding: 10px 0 8px; display: grid; gap: 2px; }
.gal figcaption b { font-weight: 600; font-size: 16px; }
.gal figcaption span { color: var(--muted); font-size: 14.5px; line-height: 1.55; }

/* วิ่งแนวนอนตามการเลื่อน (สคริปต์ใส่ .pinned ให้เฉพาะจอคอม) */
.pinned { padding-block: 0; }
.pinned .gal-stick { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding-top: var(--nav); }
.pinned .gal-stick > .wrap { width: 100%; }
.pinned .sec-head { margin-bottom: clamp(18px, 3vh, 32px); }
.pinned .gal-view { max-width: none; padding: 0; }
.pinned .gal {
  display: flex; width: max-content; gap: 20px; will-change: transform;
  padding-inline: max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
}
.pinned .gal figure { flex: none; clip-path: none; opacity: 1; scale: 1; transition: none; }
.pinned .gal img { height: min(50vh, 480px); width: auto; max-width: none; }
.pin-track { display: none; width: 100%; }
.pinned .pin-track { display: block; margin-top: 22px; }
.pin-bar { display: block; height: 2px; background: var(--gold-fill); transform: scaleX(0); transform-origin: left; box-shadow: 0 0 10px rgba(240,227,180,.6); }

dialog.light { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden; }
dialog.light[open] { display: grid; place-items: center; }
dialog.light::backdrop { background: rgba(5, 4, 2, .94); }
dialog.light figure { margin: 0; display: grid; justify-items: center; gap: 10px; max-width: 92vw; }
dialog.light img { max-height: 82vh; width: auto; border-radius: 10px; }
dialog.light img.pop { animation: pop .45s var(--ease); }
@keyframes pop { from { opacity: 0; scale: .95; } }
dialog.light figcaption { color: var(--gold-hi); font-size: 15px; text-align: center; }
dialog.light button {
  position: fixed; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; z-index: 2;
  border: 1px solid rgba(240,227,180,.35); background: rgba(0,0,0,.6); color: var(--gold-hi); font-size: 24px; line-height: 1;
  transition: background .2s ease, color .2s ease;
}
dialog.light button:hover { background: var(--gold-hi); color: var(--accent-ink); }
.light-close { top: 16px; right: 16px; }
.light-prev { left: 16px; top: 50%; margin-top: -24px; }
.light-next { right: 16px; top: 50%; margin-top: -24px; }
.light-prev::before, .light-next::before { content: ''; display: block; width: 11px; height: 11px; margin: auto; border: solid currentColor; border-width: 0 0 1.5px 1.5px; rotate: 45deg; translate: 2px 0; }
.light-next::before { rotate: -135deg; translate: -2px 0; }

/* ---------- คลิป: กรอบขยายเต็มตามการเลื่อน ---------- */
.video-frame { aspect-ratio: 16 / 9; background: #000; overflow: hidden; border-radius: var(--radius); --clip-r: 16px; }
.reveal-clip.video-frame.in { clip-path: inset(calc((1 - var(--g, 1)) * 5%) calc((1 - var(--g, 1)) * 9%) round 18px); transition: opacity .6s ease, scale 1.1s var(--ease); }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-play {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer;
  background-color: #000; background-size: cover; background-position: center;
}
.video-play::before { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 90% at 50% 50%, rgba(11,10,8,.25), rgba(11,10,8,.72)); transition: opacity .3s ease; }
.video-play:hover::before { opacity: .55; }
.play-ring {
  position: relative; display: grid; place-items: center; width: clamp(72px, 9vw, 116px); aspect-ratio: 1; border-radius: 50%;
  background: var(--gold-fill); color: var(--accent-ink); box-shadow: 0 0 0 0 rgba(240,227,180,.55); animation: pulse 2.4s ease-out infinite;
  transition: scale .3s var(--ease);
}
.video-play:hover .play-ring { scale: 1.1; }
.play-ring svg { width: 40%; height: 40%; fill: currentColor; stroke: currentColor; stroke-width: 1.5; translate: 6% 0; }
@keyframes pulse { to { box-shadow: 0 0 0 34px rgba(240,227,180,0); } }
.video-band .btn { margin-top: 24px; }

/* ---------- เสียงจากผู้เรียน ---------- */
.quotes { display: grid; gap: 14px; }
.quote { margin: 0; padding: 26px; border-radius: var(--radius); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.quote p { margin: 0 0 16px; font-size: 17px; line-height: 1.8; }
.quote figcaption { display: flex; align-items: center; gap: 12px; }
.quote img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.quote b { display: block; font-size: 15px; }
.quote span { color: var(--muted); font-size: 14px; }

/* ---------- คำถามที่พบบ่อย ---------- */
.faq { max-width: 900px; display: grid; gap: 10px; }
.faq details {
  border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); interpolate-size: allow-keywords;
  transition: background .3s ease, box-shadow .3s ease, opacity .6s ease, translate .7s var(--ease);
}
.faq details:hover { box-shadow: inset 0 0 0 1px rgba(240,227,180,.4); }
.faq details[open] { background: rgba(201,169,97,.1); box-shadow: inset 0 0 0 1px rgba(240,227,180,.55); }
.faq summary {
  cursor: pointer; padding: 18px 58px 18px 22px; min-height: 60px; font-weight: 500; position: relative;
  list-style: none; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ''; position: absolute; right: 24px; top: 29px; width: 15px; height: 2px; background: var(--gold-hi);
  transition: transform .35s var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0); }
.faq details::details-content { height: 0; overflow: clip; transition: height .4s var(--ease), content-visibility .4s allow-discrete; }
.faq details[open]::details-content { height: auto; }
.faq .faq-a { padding: 0 58px 22px 22px; color: var(--muted); margin: 0; white-space: pre-line; }

/* ---------- แถบชวนติดต่อ ---------- */
.cta-band { text-align: center; overflow: hidden; }
.cta-band .wrap { position: relative; z-index: 4; }
.cta-dark { background: radial-gradient(70% 110% at 50% 115%, rgba(201,169,97,.32), transparent 70%), var(--paper); border-top: 1px solid var(--line); }
.cta-soft { background: var(--paper-2); }
.cta-band h2 { font-size: clamp(28px, 4.4vw + 12px, 64px); font-weight: 700; margin: 0 auto 36px; max-width: 20em; line-height: 1.42; text-wrap: pretty; }
.cta-band .lights { z-index: 1; }

/* ---------- ติดต่อ ---------- */
.contact { display: grid; gap: clamp(28px, 5vw, 72px); align-items: start; }
.contact-list { display: grid; margin: 0 0 8px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.contact-list li { display: flex; gap: 16px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); min-height: 60px; min-width: 0; transition: padding .3s var(--ease); }
.contact-list li:hover { padding-left: 10px; }
.contact-list svg, .hours-one svg { width: 21px; height: 21px; flex: none; stroke: var(--accent); fill: none; stroke-width: 1.5; }
.contact-list a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--gold-hi); }
.contact-list span { overflow-wrap: anywhere; }
.hours-one { display: flex; align-items: center; gap: 16px; margin: 0; padding: 8px 0; min-height: 60px; border-bottom: 1px solid var(--line); }
.hours { margin: 0; padding: 0; list-style: none; font-size: 16px; }
.hours li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours .closed { color: var(--muted); }
.contact-side { padding: clamp(22px, 3vw, 44px); }
.map { border: 0; width: 100%; aspect-ratio: 21 / 9; display: block; min-height: 320px; background: var(--paper-2); border-radius: var(--radius);
  filter: invert(.9) hue-rotate(180deg) sepia(.32) contrast(.92); transition: filter .5s ease; }
.map:hover { filter: none; }
.map-wrap { margin-top: clamp(36px, 5vw, 64px); }
.map-open { margin-top: 16px; }

/* ช่องกรอก: ป้ายลอยขึ้น เส้นทองวิ่งตอนโฟกัส */
form.lead { display: grid; gap: 16px; position: relative; z-index: 1; }
.field { position: relative; }
.field::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold-fill);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.field:focus-within::after { transform: none; }
.field textarea + label + *, .field:has(textarea)::after { bottom: 6px; }
.field label {
  position: absolute; left: 0; top: 22px; font-size: 16px; line-height: 1.5; color: var(--muted); pointer-events: none;
  transition: top .25s var(--ease), font-size .25s var(--ease), color .2s ease;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: 0; font-size: 14px; color: var(--gold-hi); }
form.lead input, form.lead textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 22px 0 10px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); outline: 0;
}
form.lead input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: inset 0 0 0 40px var(--paper-2); }
form.lead textarea { min-height: 120px; resize: vertical; display: block; }
form.lead .hp { position: absolute; left: -9999px; width: 1px; }
form.lead .btn { width: 100%; cursor: pointer; font-family: inherit; margin-top: 6px; }
form.lead .msg { font-size: 15px; margin: 0; }
form.lead .msg:empty { display: none; }
form.lead .msg.ok { color: var(--gold-hi); }
form.lead .msg.bad { color: #f19a8a; }

/* ---------- บทความ (ของขายเสริม) ---------- */
.a-wrap { max-width: 760px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { text-decoration: none; }
.a-wrap h1 { font-size: clamp(28px, 4.2vw, 44px); font-weight: 600; margin-bottom: 12px; }
.a-meta { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.a-cover { margin: 0 0 26px; }
.a-cover img { width: 100%; }
.a-lead { font-size: 18px; color: var(--muted); margin: 0 0 26px; line-height: 1.8; }
.a-toc { border: 1px solid var(--line); padding: 18px 22px; margin-bottom: 32px; border-radius: 12px; }
.a-toc b { display: block; font-size: 15px; margin-bottom: 8px; }
.a-toc ol { margin: 0; padding-inline-start: 20px; }
.a-toc li { margin-bottom: 5px; }
.a-toc a { color: var(--muted); text-decoration: none; }
.a-body > * { margin-block: 0 20px; }
.a-body h2 { font-size: clamp(22px, 3vw, 28px); margin-block: 44px 14px; scroll-margin-top: 92px; }
.a-body h3 { font-size: clamp(18px, 2.4vw, 21px); margin-block: 30px 10px; }
.a-body p { line-height: 1.9; }
.a-body a:not(.btn) { color: var(--gold-hi); text-underline-offset: 3px; }
.a-body ul, .a-body ol { padding-inline-start: 24px; line-height: 1.9; }
.a-body blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-inline-start: 2px solid var(--accent); }
.a-body blockquote cite { color: var(--muted); font-size: 15px; font-style: normal; }
.a-fig { margin: 28px 0; }
.a-fig img { width: 100%; }
.a-fig figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; text-align: center; }
.a-cta { border: 1px solid var(--line); padding: 24px; text-align: center; margin: 32px 0; border-radius: 12px; }
.a-cta p { margin: 0 0 14px; }
.a-embed { margin: 32px 0; }
.a-embed h3 { margin-block: 0 14px; font-size: 18px; }
.a-related ul { list-style: none; padding: 0; margin: 0; display: grid; }
.a-related li a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); text-decoration: none; }

/* ---------- หัวเว็บ — ห้ามใส่ backdrop-filter/transform บนตัวหัวเว็บเพราะครอบเมนูเต็มจอ
   พื้นเบลอจึงอยู่ที่ ::before ซึ่งไม่ได้ครอบเมนู ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 30; }
.nav::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease;
  background: rgba(11,10,8,.72); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.nav.scrolled::before { opacity: 1; }
.nav > .wrap { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--nav); }
.nav .logo { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; flex: none; transition: scale .3s var(--ease); }
.nav .logo:hover { scale: 1.05; }
.nav .logo img { height: 36px; width: auto; }
.nav-toggle {
  position: relative; z-index: 52; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; padding: 0;
  display: grid; place-content: center; gap: 8px;
}
.nav-toggle span { display: block; width: 26px; height: 1.5px; background: var(--gold-hi); transition: transform .3s var(--ease); }
body.nav-open .nav-toggle span:first-child { transform: translateY(4.75px) rotate(45deg); }
body.nav-open .nav-toggle span:last-child { transform: translateY(-4.75px) rotate(-45deg); }
.nav-menu {
  position: fixed; inset: 0; z-index: 51; padding: 96px var(--pad) 40px;
  background: radial-gradient(90% 60% at 50% 0%, rgba(201,169,97,.22), transparent 70%), var(--paper);
  display: none; flex-direction: column; gap: 0; overflow-y: auto; counter-reset: m;
}
body.nav-open { overflow: hidden; }
body.nav-open .nav-menu { display: flex; }
body.nav-open .float-contact { display: none; }
.nav-menu > a:not(.btn) {
  display: flex; align-items: center; gap: 18px; min-height: 64px; text-decoration: none; font-size: 26px; font-weight: 600;
  border-bottom: 1px solid var(--line); color: var(--ink); counter-increment: m;
}
.nav-menu > a:not(.btn)::before { content: counter(m, decimal-leading-zero); font-size: 15px; font-weight: 600; color: var(--accent); }
.nav-menu > a[aria-current="page"] { color: var(--gold-hi); }
body.nav-open .nav-menu > * { animation: menuIn .55s var(--ease) both; }
body.nav-open .nav-menu > :nth-child(2) { animation-delay: 50ms; }
body.nav-open .nav-menu > :nth-child(3) { animation-delay: 100ms; }
body.nav-open .nav-menu > :nth-child(4) { animation-delay: 150ms; }
body.nav-open .nav-menu > :nth-child(5) { animation-delay: 200ms; }
body.nav-open .nav-menu > :nth-child(6) { animation-delay: 250ms; }
body.nav-open .nav-menu > :nth-child(7) { animation-delay: 300ms; }
@keyframes menuIn { from { opacity: 0; translate: 0 22px; } }
.nav-cta { margin-top: 28px; flex: none; }

/* ---------- ท้ายเว็บ ---------- */
.foot { border-top: 1px solid var(--line); padding-top: clamp(48px, 7vw, 88px); background: var(--paper); overflow: hidden; }
.foot .wrap { display: grid; gap: 40px; padding-bottom: 28px; }
.foot-logo { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 14px; }
.foot-logo img { height: 40px; width: auto; }
.foot-brand > b { display: block; font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.foot p { margin: 0 0 10px; color: var(--muted); font-size: 15.5px; line-height: 1.7; max-width: 44ch; }
.foot-col > b { display: block; color: var(--accent); font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.foot-col > a { display: flex; align-items: center; min-height: 44px; text-decoration: none; font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; transition: color .2s ease, translate .3s var(--ease); }
.foot-col > a:hover { color: var(--gold-hi); translate: 6px 0; }
.foot .social { display: flex; gap: 8px; margin-top: 8px; }
.foot .social a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(240,227,180,.3); color: var(--gold-hi); transition: background .25s ease, color .25s ease, rotate .4s var(--ease); }
.foot .social a:hover { background: var(--gold-hi); color: var(--accent-ink); rotate: -8deg; }
.foot .social svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.foot small { color: var(--muted); font-size: 14px; padding-top: 22px; border-top: 1px solid var(--line); }
/* ชื่อแบรนด์ตัวโตเต็มจอ เติมสีทองตามการเลื่อน */
.foot-mark {
  font-size: 9.2vw; font-weight: 700; line-height: 1.25; text-align: center; white-space: nowrap; letter-spacing: -.01em; padding-bottom: .04em;
  color: transparent; -webkit-text-stroke: 1px rgba(240,227,180,.3);
  background: linear-gradient(90deg, #d4b56d, #fff6d8 calc(var(--w, 1) * 100%), transparent calc(var(--w, 1) * 100% + 4%)); -webkit-background-clip: text; background-clip: text;
}

/* ปุ่มติดต่อลอยล่างจอมือถือ */
.float-contact { display: none; }
@media (max-width: 960px) {
  .float-contact {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: rgba(11,10,8,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px var(--pad) calc(6px + env(safe-area-inset-bottom, 0px)); gap: 10px;
  }
  .float-contact .btn { flex: 1; padding-inline: 12px; min-height: 46px; }
  body { padding-bottom: 60px; }
}

/* ---------- จอขนาดกลาง ---------- */
@media (max-width: 479px) {
  .gal figcaption b { font-size: 15px; }
  .card-body h3 { font-size: 17px; }
  .hero-full .hero-media { transform: perspective(900px) rotateX(calc((1 - var(--z, 1)) * 9deg)) scale(calc(.94 + var(--z, 1) * .06)); }
}
@media (min-width: 480px) {
  .gal { grid-template-columns: repeat(3, 1fr); }
  .features-grid:not(.timeline) { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  .about { grid-template-columns: 1fr 1fr; }
  .about.pic-right .about-text { order: -1; }
  .contact { grid-template-columns: 1fr 1fr; }
  .quotes { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .hero-compact .hero-slide, .hero-split .hero-slide {
    flex-direction: row; align-items: center; min-height: min(84vh, 780px);
    padding-inline: max(0px, calc((100vw - var(--max)) / 2));
  }
  .hero-compact .hero-media, .hero-split .hero-media { flex: 0 0 min(42vw, 560px); width: auto; margin: 24px var(--pad) 40px 0; }
  .hero-compact .hero-body, .hero-split .hero-body { flex: 1 1 0; min-width: 0; }
  .faq-layout > .sec-head { margin-bottom: clamp(28px, 4vw, 48px); }
}
@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(var(--cols, 3), 1fr); gap: clamp(16px, 2.2vw, 32px); align-items: start; }
  .cards > :last-child:nth-child(odd) { grid-column: auto; }
  /* เหลื่อมระดับให้จังหวะ ไม่เรียงเป็นตารางน่าเบื่อ */
  .cards > :nth-child(3n + 2) { margin-top: clamp(32px, 5vw, 72px); }
  .cards > :nth-child(3n) { margin-top: clamp(14px, 2.4vw, 32px); }
  .gal { gap: 16px; }
  /* คำบรรยายลอยบนรูป เลื่อนขึ้นตอนชี้ */
  .gal figure > a + figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px; pointer-events: none;
    background: linear-gradient(to top, rgba(5,4,2,.92), transparent); border-radius: 0 0 12px 12px;
  }
  .gal figure > a + figcaption span { color: #e8e2d4; }
}
@media (min-width: 768px) and (hover: hover) {
  .gal figure > a + figcaption { opacity: 0; translate: 0 10px; transition: opacity .35s ease, translate .45s var(--ease); }
  .gal figure:hover > a + figcaption { opacity: 1; translate: 0 0; }
}
@media (max-width: 767px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .gal { grid-template-columns: repeat(var(--cols, 4), 1fr); }
  /* รูปแรกใหญ่ตามแบบอ้างอิง เฉพาะชุดที่จำนวนลงตัวพอดี */
  .gal:has(> figure:nth-child(5):last-child) > figure:first-child { grid-column: span 2; grid-row: span 2; }
  .features-grid:not(.timeline) { grid-template-columns: repeat(var(--cols, 4), 1fr); }
  .features-grid:not(.timeline) > :nth-child(even) { margin-top: 36px; margin-bottom: -36px; }
  .features-grid:not(.timeline) { margin-bottom: 36px; }
  /* เส้นทางแนวนอน */
  .timeline { grid-template-columns: repeat(var(--cols, 4), 1fr); }
  .timeline::before, .timeline::after { left: 28px; right: calc(25% - 28px); top: 27px; bottom: auto; width: auto; height: 2px; }
  .timeline::after { transform: scaleX(var(--p)); transform-origin: left; }
  .timeline .feature { padding: 76px 24px 0 0; }
  .timeline .feature > :last-child { min-height: 0; display: block; }
  .faq-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
  .faq-layout > .sec-head { position: sticky; top: 110px; margin: 0; }
  .faq-layout > .sec-head h2 { font-size: clamp(32px, 3.6vw, 52px); }
  .foot .wrap { grid-template-columns: 1.5fr 1fr 1.2fr; }
  .foot small { grid-column: 1 / -1; }
}
/* เมนูเดสก์ท็อปเรียงในหัวเว็บ */
@media (min-width: 961px) {
  .nav-toggle { display: none; }
  .nav-menu {
    position: static; display: flex; flex-direction: row; align-items: center; gap: clamp(14px, 2vw, 30px);
    padding: 0; background: transparent; overflow: visible;
  }
  .nav-menu > a:not(.btn) {
    position: relative; min-height: 44px; font-size: 15.5px; font-weight: 500; border: 0; color: var(--ink); white-space: nowrap; opacity: .82;
    transition: color .2s ease, opacity .2s ease;
  }
  .nav-menu > a:not(.btn)::before { display: none; }
  .nav-menu > a:not(.btn)::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; background: var(--gold-fill);
    transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
  }
  .nav-menu > a:not(.btn):hover, .nav-menu > a[aria-current="page"] { color: var(--gold-hi); opacity: 1; }
  .nav-menu > a:not(.btn):hover::after, .nav-menu > a[aria-current="page"]::after { transform: none; transform-origin: left; }
  .nav-cta { margin: 0 0 0 8px; min-height: 44px; padding: 8px 22px; font-size: 15px; }
}

/* โหมดแก้หน้าเว็บ: ไม่ให้แสงหรือการเอียงขวางการคลิก */
.is-edit .hero-full .hero-media, .is-edit .card { transform: none; }
.is-edit .lights, .is-edit .hero-full .hero-media::after { display: none; }
.is-edit .nav { position: sticky; }
.is-edit .hero-full .hero-body { opacity: 1; translate: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-full .hero-media, .card { transform: none; }
  .hero-full .hero-body { opacity: 1; translate: none; }
  .lights i:nth-child(1) { transform: rotate(14deg); }
  .lights i:nth-child(2) { transform: rotate(-6deg); }
  .lights i:nth-child(3) { transform: rotate(6deg); }
  .lights i:nth-child(4) { transform: rotate(-14deg); }
  .reveal, .reveal-clip { opacity: 1; translate: none; clip-path: none; scale: 1; }
  .hero-compact .hero-media { animation: none; }
}
