/* หน้าเว็บรวมช่อง · สีและฟอนต์มาจากตัวแปรที่ build.py ใส่ในแต่ละหน้า */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 16px/1.6 "Anuphan", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100dvh;
}
a { color: inherit; }
body::before { /* แสงหลังโลโก้ */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55vmax 55vmax at 24% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(40vmax 40vmax at 95% 105%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
}
.light body::before, body.light::before {
  background: radial-gradient(55vmax 55vmax at 24% 30%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%);
}
#sky { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.wrap { position: relative; z-index: 2; width: min(1080px, 100%); margin: 0 auto; padding: 0 clamp(18px, 5vw, 48px); }

/* แถบบน */
.top { display: flex; justify-content: flex-end; padding-top: max(16px, env(safe-area-inset-top)); }
.top a {
  font: 600 14px/1 "Anuphan", sans-serif; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; min-height: 40px; display: inline-flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.top a:hover, .top a:focus-visible { color: var(--text); border-color: var(--accent); outline: none; }

/* ส่วนหัว */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center;
  gap: clamp(24px, 6vw, 80px); padding: clamp(16px, 4vh, 40px) 0 clamp(36px, 6vh, 64px);
}
.stage { position: relative; justify-self: end; width: min(400px, 100%); }
.orb { position: relative; width: 100%; aspect-ratio: 1; }
.ring {
  position: absolute; inset: -6%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20%, color-mix(in srgb, var(--accent) 70%, transparent) 32%, transparent 46% 70%, color-mix(in srgb, var(--accent2) 45%, transparent) 80%, transparent 92%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  animation: spin 20s linear infinite;
}
.ring.r2 { inset: -12%; opacity: .45; animation-duration: 34s; animation-direction: reverse; }
.logo {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 60px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 150px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: box-shadow .5s; animation: breathe 5s ease-in-out infinite;
}
.logo img { width: 100%; height: 100%; display: block; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.stage.excited .logo img { transform: scale(1.05) rotate(-2deg); }
.stage.excited .logo { box-shadow: 0 0 0 1px var(--accent), 0 0 90px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 200px color-mix(in srgb, var(--accent) 30%, transparent); }

.bubble {
  position: absolute; right: -8%; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px;
  background: var(--bubbleBg, #fff8ef); color: #1a1310; border-radius: 18px; padding: 8px 16px 8px 8px;
  font: 600 15px/1.35 "Anuphan", sans-serif; max-width: 260px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 2px var(--accent);
  transform-origin: 20% 100%;
}
.bubble::after {
  content: ""; position: absolute; left: 32px; bottom: -9px; width: 18px; height: 18px; background: var(--bubbleBg, #fff8ef);
  transform: rotate(45deg); box-shadow: 2px 2px 0 0 var(--accent); border-radius: 0 0 4px 0;
}
.bubble img { width: 44px; height: 44px; flex: none; border-radius: 12px; display: block; position: relative; z-index: 1; }
.bubble span { position: relative; z-index: 1; text-wrap: pretty; }
.bubble.pop { animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
.bubble.pop img { animation: nod .5s ease; }

.kicker { font: 600 15px/1.4 "Anuphan", sans-serif; color: var(--link); margin: 0 0 2px; display: flex; align-items: center; gap: 12px; }
.kicker::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
h1 {
  font-family: var(--display), "Anuphan", sans-serif; font-weight: var(--displayWeight); margin: 0;
  font-size: clamp(54px, 8vw, 88px); line-height: var(--h1lh); letter-spacing: -.01em; padding: var(--h1pad);
  color: var(--text); text-shadow: 0 0 34px color-mix(in srgb, var(--accent) 40%, transparent);
}
h1.long { font-size: clamp(40px, 5.2vw, 60px); }
.en { font: 500 16px/1.3 "Anuphan", sans-serif; color: var(--muted); margin: 0; }
.tag { font-size: 17px; line-height: 1.65; color: color-mix(in srgb, var(--text) 85%, var(--muted)); margin: 16px 0 6px; max-width: 34em; text-wrap: pretty; }
.sched { font-size: 14px; color: var(--muted); margin: 0 0 24px; }

/* ปุ่มติดตาม */
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.quest { display: flex; align-items: center; gap: 12px; font: 600 14px/1 "Anuphan", sans-serif; color: var(--muted); margin-bottom: 2px; }
.quest .pips { display: flex; gap: 6px; margin-left: auto; }
.quest .pips i { width: 26px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text) 40%, transparent); transition: background .3s, box-shadow .3s; }
.quest .pips i.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.quest b { min-width: 28px; text-align: right; }
.quest.all, .quest.all b { color: var(--accent); }

.social {
  position: relative; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px;
  min-height: 72px; padding: 10px 14px 10px 12px; border-radius: 16px; text-decoration: none; color: var(--cardText);
  background: linear-gradient(135deg, var(--cardA), var(--cardB));
  box-shadow: 0 14px 36px -18px color-mix(in srgb, var(--cardA) 90%, transparent), inset 0 1px 0 rgba(255,255,255,.22);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, filter .25s;
}
.social::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(160px 100px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.25), transparent 70%);
}
.social:hover, .social:focus-visible { transform: translateX(6px); filter: brightness(1.08); outline: none; box-shadow: 0 20px 50px -14px color-mix(in srgb, var(--cardA) 95%, transparent), inset 0 1px 0 rgba(255,255,255,.3); }
.social:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.social:hover::before, .social:focus-visible::before { opacity: 1; }
.social:not(.opened)::after { content: ""; position: absolute; inset: -1px; border-radius: 16px; pointer-events: none; animation: ping 3.6s ease-out infinite; }
.links li:nth-child(3) .social::after { animation-delay: 1.2s; }
.links li:nth-child(4) .social::after { animation-delay: 2.4s; }
.ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.ico svg { width: 25px; height: 25px; fill: #fff; }
.youtube .ico { background: #ff0000; }
.tiktok .ico { background: #010101; }
.tiktok .ico svg { filter: drop-shadow(-2px -1px 0 #25f4ee) drop-shadow(2px 1px 0 #fe2c55); }
.facebook .ico { background: #1877f2; }
.lt b { display: block; font: 700 18px/1.25 "Anuphan", sans-serif; }
.lt small { display: block; font-size: 13.5px; opacity: .85; margin-top: 2px; }
.cta {
  font: 700 14px/1 "Anuphan", sans-serif; white-space: nowrap; color: var(--ctaText); background: #fff;
  border-radius: 999px; padding: 11px 16px; box-shadow: 0 3px 0 rgba(0,0,0,.18); transition: transform .2s;
}
.social:hover .cta { transform: translateY(-2px) scale(1.04); }
.cta-b { display: none; }
.social.opened .cta { background: rgba(0,0,0,.28); color: #fff; box-shadow: none; }
.social.opened .cta-a { display: none; }
.social.opened .cta-b { display: inline; }
.chip {
  margin-top: 14px; font: 500 14px/1 "Anuphan", sans-serif; color: var(--text); background: none; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--text) 40%, transparent); border-radius: 999px; padding: 10px 16px; min-height: 40px;
}
.chip:hover, .chip:focus-visible { color: var(--text); border-color: var(--accent); outline: none; }

/* ผลงานล่าสุด */
section.block { padding: clamp(28px, 5vh, 48px) 0; border-top: 1px solid var(--line); }
.bh { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h2 { font-family: var(--display), "Anuphan", sans-serif; font-weight: var(--displayWeight); font-size: clamp(26px, 3.4vw, 34px); line-height: 1.35; margin: 0; }
h3.sub { font: 600 15px/1.4 "Anuphan", sans-serif; color: var(--muted); margin: 22px 0 12px; }
.bh + h3.sub { margin-top: 0; }
.bh a { font-size: 15px; font-weight: 600; color: var(--link); text-decoration: none; white-space: nowrap; }
.bh a:hover, .bh a:focus-visible { text-decoration: underline; outline: none; }
.works { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.work a { display: block; text-decoration: none; border-radius: 14px; outline-offset: 4px; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.thumb .kind {
  position: absolute; left: 8px; bottom: 8px; font: 600 12px/1 "Anuphan", sans-serif; color: #fff;
  background: rgba(0,0,0,.65); border-radius: 6px; padding: 5px 7px;
}
.work a:hover .thumb img, .work a:focus-visible .thumb img { transform: scale(1.06); }
.work a:focus-visible { outline: 2px solid var(--accent); }
.works.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.works.n1 { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.works.shorts { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.vert .thumb { aspect-ratio: 9 / 16; }
.vert .t { font-size: 13.5px; -webkit-line-clamp: 3; }
.work .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; line-height: 1.5; margin-top: 10px; }
.work .d { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ช่องอื่นของเรา */
.family { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 0; }
.sib {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; height: 100%;
  padding: 14px; border-radius: 16px; text-decoration: none; color: var(--sText);
  background: var(--sBg); border: 1px solid var(--sLine);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s;
}
.sib img { width: 64px; height: 64px; border-radius: 50%; display: block; box-shadow: 0 0 0 2px var(--sAccent); }
.sib b { display: block; font: 700 19px/1.25 var(--sDisplay), "Anuphan", sans-serif; }
.sib small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; font-size: 13.5px; line-height: 1.45; color: var(--sMuted); margin-top: 3px; }
.sib .go { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--sLink); }
.sib:hover, .sib:focus-visible { transform: translateY(-4px); border-color: var(--sAccent); box-shadow: 0 16px 40px -18px var(--sAccent); outline: none; }

footer { position: relative; z-index: 2; text-align: center; padding: 28px 20px 36px; font-size: 14px; color: var(--muted); font-style: italic; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 9; transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); font: 600 14px/1 "Anuphan", sans-serif; padding: 12px 18px; border-radius: 999px;
  transition: .25s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* หน้ารวม */
.hub-head { padding: clamp(40px, 9vh, 90px) 0 clamp(24px, 4vh, 40px); }
.hub-head h1 { font-family: "Anuphan", sans-serif; font-size: clamp(44px, 7vw, 76px); text-shadow: none; }
.hub-head p { font-size: 18px; color: var(--muted); margin: 12px 0 0; }
.hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0 0 40px; }
.tile {
  position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: center; overflow: hidden;
  min-height: 190px; padding: 24px; border-radius: 22px; text-decoration: none;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--sAccent) 26%, var(--sBg)), var(--sBg) 60%);
  color: var(--sText); border: 1px solid var(--sLine);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
}
.tile img { width: 112px; height: 112px; border-radius: 50%; display: block; box-shadow: 0 0 0 2px var(--sAccent), 0 0 40px color-mix(in srgb, var(--sAccent) 40%, transparent); }
.tile b { display: block; font: 700 32px/1.15 var(--sDisplay), "Anuphan", sans-serif; }
.tile small { display: block; font-size: 15px; line-height: 1.5; color: var(--sMuted); margin-top: 6px; }
.tile .new { display: -webkit-box; -webkit-line-clamp: 2; line-height: 1.5; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; color: var(--sText); opacity: .8; margin-top: 8px; }
.tile .go { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--sCta); background: var(--sAccent); border-radius: 999px; padding: 9px 16px; }
.tile:hover, .tile:focus-visible { transform: translateY(-5px); border-color: var(--sAccent); box-shadow: 0 24px 60px -24px var(--sAccent); outline: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: translateY(-6px); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes nod { 30% { transform: rotate(-8deg) scale(1.08); } 60% { transform: rotate(5deg); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cardA) 35%, transparent); } 40%, 100% { box-shadow: 0 0 0 8px transparent; } }

@media (max-width: 860px) {
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family { grid-template-columns: 1fr; }
  .hub { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 0; padding-top: 4px; text-align: center; }
  .stage { justify-self: center; width: 100%; display: flex; flex-direction: column; align-items: center; margin-bottom: 18px; }
  .orb { width: clamp(150px, 46vw, 190px); }
  .ring.r2 { display: none; }
  .bubble { position: relative; right: auto; top: auto; margin-top: 20px; max-width: min(340px, 92%); font-size: 14px; text-align: left; padding: 6px 14px 6px 6px; }
  .bubble::after { left: 50%; bottom: auto; top: -9px; margin-left: -9px; box-shadow: -2px -2px 0 0 var(--accent); border-radius: 4px 0 0 0; }
  .bubble img { width: 36px; height: 36px; border-radius: 10px; }
  .kicker { justify-content: center; font-size: 14px; }
  .kicker::before { display: none; }
  h1 { font-size: clamp(42px, 13vw, 56px); }
  h1.long { font-size: clamp(34px, 10vw, 46px); }
  .tag { font-size: 15.5px; margin: 12px auto 4px; }
  .sched { margin-bottom: 18px; }
  .links { text-align: left; }
  .social { min-height: 64px; grid-template-columns: 42px 1fr auto; gap: 12px; }
  .ico { width: 42px; height: 42px; border-radius: 12px; }
  .lt b { font-size: 16.5px; }
  .lt small { font-size: 12.5px; }
  .cta { font-size: 13px; padding: 10px 12px; }
  .social:hover, .social:focus-visible { transform: none; }
  .bh { flex-wrap: wrap; }
  .works, .works.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.works.n1 { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.works.shorts { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 calc(-1 * clamp(18px, 5vw, 48px)); padding: 0 clamp(18px, 5vw, 48px) 6px; scroll-padding-left: clamp(18px, 5vw, 48px); }
  .work { flex: 0 0 74%; scroll-snap-align: start; }
  .work.vert { flex-basis: 38%; }
  .tile { grid-template-columns: 80px 1fr; min-height: 0; padding: 18px; gap: 16px; }
  .tile img { width: 80px; height: 80px; }
  .tile b { font-size: 24px; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .works.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.works.n1 { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.works.shorts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
