/*!
 * Creative Spark — Creative Media Playground
 * พัฒนาระบบโดย อาจารย์ ดร.วรวิทย์ สังฆทิพย์
 * ภาควิชาสื่อนฤมิต คณะวิทยาการสารสนเทศ มหาวิทยาลัยมหาสารคาม
 * อีเมล worawith.s@msu.ac.th
 */
/* ═══════════════════════════════════════════════════════════════════
   Creative Spark — สไตล์หลักของทั้งเว็บ (CSS ธรรมดา ไม่ต้อง build)
   ออกแบบจากจอ 360px ก่อน · จุดตัด: 640px (sm) · 768px (md) · 1024px (lg)
   ═══════════════════════════════════════════════════════════════════ */

/* ───────────── Design tokens (docs/design-brief.md › สีและ design tokens) ───────────── */
:root {
  --bg: #06070B;
  --surface: #0F131C;
  --line: #1C2230;
  --text: #EEF3F8;
  --muted: #93A0B4;
  --sky: #4EACEA;
  --indigo: #2E338E;
  --indigo-bright: #8C93FF;
  --teal: #49A29C;
  --teal-bright: #5CC8C0;
  --spark: #FFB347;
  --grad-cmd: linear-gradient(120deg, #4EACEA 0%, #2E338E 36%, #49A29C 58%, #49A29C 100%);

  /* ค่าเริ่มต้นของ accent เมื่อไม่ได้อยู่ในสายใด */
  --accent: var(--text);
  --accent-fill: var(--line);

  --font-head: "Chakra Petch", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-pixel: "Press Start 2P", "Chakra Petch", monospace;

  --cut: 14px;
  --header-h: 3.5rem;
  color-scheme: dark;
}
[data-major="animation"] { --accent: var(--sky); --accent-fill: var(--sky); }
[data-major="game"]      { --accent: var(--indigo-bright); --accent-fill: var(--indigo); }
[data-major="film"]      { --accent: var(--teal-bright); --accent-fill: var(--teal); }

/* ───────────── Reset ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol, address { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
picture { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
address { font-style: normal; }
[hidden] { display: none !important; }

/* ───────────── Base ───────────── */
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: url("../img/honeycomb.svg");
  background-size: 28px 50px;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: clip;
}
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}
:focus-visible { outline: 2px solid var(--spark); outline-offset: 3px; }
::selection { background: var(--spark); color: var(--bg); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 1rem; z-index: 100;
  padding: 0.5rem 1rem; background: var(--spark); color: var(--bg); font-weight: 500;
}
.skip-link:focus { left: 1rem; position: fixed; }

.muted { color: var(--muted); }
.accent { color: var(--accent); }
.pending { font-style: italic; }

.container-x { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 768px) { .container-x { padding-inline: 2rem; } }

/* ส่วนที่ต้องใช้ JS: ซ่อนไว้จนกว่า JS จะทำงาน */
html:not(.js) .js-only { display: none !important; }

/* แสดงเฉพาะมือถือ / เฉพาะจอ ≥ 640px */
.hide-mobile { display: none !important; }
@media (min-width: 640px) {
  .hide-mobile { display: inline-flex !important; }
  .show-mobile { display: none !important; }
}

/* ทำให้ลิงก์ครอบทั้งการ์ด */
.stretched::after { content: ""; position: absolute; inset: 0; }

/* ───────────── ลักษณะภาพที่ยืมจากโลโก้ ───────────── */

/* มุมตัดเฉียง: บนซ้ายและล่างขวา */
.cut, .cut-sm, .cut-frame, .btn, .chip {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.cut-sm { --cut: 10px; }

/* กรอบมุมตัดที่มีเส้นขอบ: ใช้พื้นของ .cut-frame เป็นสีเส้น และวาง .cut-frame-inner ไว้ข้างใน */
.cut-frame { background: var(--frame, var(--line)); padding: 1px; transition: background-color 0.2s; }
.cut-frame-inner {
  --c: calc(var(--cut) - 0.4px);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  background: var(--surface);
  height: 100%;
}

/* ป้ายกำกับภาษาอังกฤษ เลียนแบบคำว่า CREATIVE MEDIA ในโลโก้ */
.eyebrow {
  font-family: var(--font-head);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* แถบเฉียงไล่สี: ตัวเปลี่ยนฉากระหว่างส่วน */
.diag-band { height: 2.5rem; position: relative; overflow: hidden; }
.diag-band::before {
  content: ""; position: absolute; inset: 0.9rem -2rem;
  background: var(--grad-cmd); transform: skewY(-1.4deg); opacity: 0.9;
}
.diag-band::after {
  content: ""; position: absolute; inset: 1.55rem -2rem auto; height: 2px;
  background: var(--line); transform: skewY(-1.4deg);
}

/* ───────────── ปุ่ม ───────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  min-width: 2.75rem;
  padding: 0.625rem 1.5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  --cut: 12px;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
/* ปุ่มหลัก --spark: ใช้ได้ไม่เกินหน้าละ 1 ปุ่ม ข้อความใช้สี --bg */
.btn-spark { background: var(--spark); color: var(--bg); }
.btn-spark:hover { background: #ffc46e; }
/* ปุ่มรอง: เส้นขอบสี accent ทำด้วยเงาภายในเพราะ clip-path ตัดเส้นขอบที่มุม */
.btn-ghost {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-fill) 14%, var(--bg));
  box-shadow: inset 0 0 0 2px var(--accent);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--accent-fill) 28%, var(--bg)); }
.btn-neutral { --accent: var(--text); --accent-fill: var(--line); }
.btn-text { color: var(--muted); }
.btn-text:hover { color: var(--text); }
.btn-block { width: 100%; }
.btn-self { align-self: flex-start; }

/* ───────────── ป้าย ───────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent-fill) 16%, transparent);
}
.badge__dot { width: 0.375rem; height: 0.375rem; background: var(--accent); }
.badge-sample {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-head);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--bg);
}
.badge-sample.is-corner { position: absolute; right: 0.75rem; top: 0.75rem; }

.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); }

/* ───────────── แถบปัดแนวนอน ───────────── */
.swipe-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.swipe-row::-webkit-scrollbar { display: none; }
.swipe-row > * { scroll-snap-align: start; flex: none; }

/* ───────────── หัวข้อของแต่ละส่วน: ป้ายอังกฤษ + หัวข้อไทย + เส้นหนาหักมุมฉาก ───────────── */
.section { padding-block: 4rem; }
@media (min-width: 640px) { .section { padding-block: 6rem; } }

.section-head { position: relative; padding: 1rem 0 0 1.25rem; }
.section-head::before {
  content: ""; position: absolute; left: 0; top: 0; width: 0.375rem; height: 100%;
  background: var(--accent-line, var(--grad-cmd));
}
.section-head::after {
  content: ""; position: absolute; left: 0; top: 0; width: 2.5rem; height: 0.375rem;
  background: var(--accent-line, var(--sky));
}
.section-title { margin-top: 0.25rem; font-size: 1.75rem; }
@media (min-width: 640px) { .section-title { font-size: 2.25rem; } }
.section-lead { margin-top: 0.5rem; max-width: 42rem; color: var(--muted); }

.section-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.more-link {
  display: inline-flex; min-height: 2.75rem; align-items: center; gap: 0.5rem;
  font-family: var(--font-head); font-weight: 500; color: var(--muted);
}
.more-link:hover { color: var(--text); }

/* ภาพที่เต็มกรอบ */
.work-card__media img, .spotlight__media img, .door__preview img, .act-media img, .coming__media img {
  width: 100%; height: 100%; object-fit: cover;
}
.work-card__media picture, .spotlight__media picture, .door__preview picture, .act-media picture, .coming__media picture {
  width: 100%; height: 100%;
}

/* ═════════════ แถบเมนู ═════════════ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.site-header__bar { display: flex; height: var(--header-h); align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; min-height: 2.75rem; align-items: center; gap: 0.75rem; }
.brand__logo { height: 22px; width: auto; }
.brand__name { font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; letter-spacing: 0.025em; }

.nav-desktop { display: none; }
.nav-desktop ul { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  position: relative; display: inline-flex; min-height: 2.75rem; align-items: center; padding-inline: 0.75rem;
  font-family: var(--font-head); font-weight: 500; font-size: 0.9375rem; letter-spacing: 0.05em; color: var(--muted);
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text); }
.nav-link, .nav-account { white-space: nowrap; }
.brand { flex-shrink: 0; }
.brand__name { white-space: nowrap; }
.nav-link[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.4rem; height: 2px; background: var(--grad-cmd);
}
/* แท็บเล็ต (768–1023px): เมนูแน่น — ลดระยะ */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .nav-link { padding-inline: 0.5rem; letter-spacing: 0.02em; }
  .brand__name { font-size: 1rem; }
}

.burger-btn { display: flex; width: 2.75rem; height: 2.75rem; cursor: pointer; list-style: none; align-items: center; justify-content: center; }
.burger-btn::-webkit-details-marker { display: none; }
.burger { display: grid; gap: 5px; width: 22px; }
.burger span { height: 2px; background: currentColor; transition: transform 0.25s, opacity 0.25s; }
.burger span:nth-child(2) { width: 70%; justify-self: end; }
.mobile-menu[open] .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu[open] .burger span:nth-child(2) { opacity: 0; }
.mobile-menu[open] .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-panel {
  position: fixed; inset: var(--header-h) 0 auto 0;
  background: var(--bg); border-bottom: 1px solid var(--line);
  max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
}
.mobile-panel ul { padding-block: 1rem; }
.mobile-link { display: flex; min-height: 3.5rem; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-top: 0.75rem; }
.mobile-link__en { font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; }
.mobile-link__th { color: var(--muted); }

@media (min-width: 768px) {
  .nav-desktop { display: block; }
  .mobile-menu { display: none; }
}

/* ═════════════ ส่วนท้าย ═════════════ */
.site-footer { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.footer-grid { display: grid; gap: 2.5rem; padding-block: 3rem; }
.footer-logo { display: inline-block; padding-block: 0.5rem; }
.footer-logo img { height: 2.75rem; width: auto; }
.footer-tag { margin-top: 0.75rem; }
.footer-org { margin-top: 1.5rem; }
.footer-org__name { font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; }
.footer-org__en { margin-top: 0.75rem; font-family: var(--font-head); font-weight: 500; }
.footer-links { margin-top: 1rem; display: grid; gap: 0.25rem; }
.footer-links a { display: inline-flex; min-height: 2.75rem; align-items: center; gap: 0.5rem; }
.footer-links a:hover .footer-links__en, .footer-main-link:hover, .footer-contacts a:hover { text-decoration: underline; }
.footer-links__en { font-family: var(--font-head); font-weight: 500; }
.footer-contacts { margin-top: 1rem; display: grid; gap: 0.75rem; }
.footer-contacts li { display: flex; flex-wrap: wrap; column-gap: 0.5rem; }
.footer-main-link { display: inline-flex; min-height: 2.75rem; align-items: center; gap: 0.5rem; font-weight: 500; }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom__row { display: flex; flex-direction: column; gap: 0.25rem; padding-block: 1.25rem; font-size: 0.875rem; color: var(--muted); }
@media (min-width: 640px) { .footer-bottom__row { flex-direction: row; justify-content: space-between; } }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; padding-block: 4rem; } }

/* ═════════════ การ์ดผลงาน ═════════════ */
.work-card { position: relative; height: 100%; }
.work-card__frame { height: 100%; --frame: var(--line); }
.work-card:hover .work-card__frame, .work-card:focus-within .work-card__frame { --frame: var(--accent); }
.work-card__inner { display: flex; flex-direction: column; }
.work-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); }
.work-card__media img { transition: transform 0.5s; }
.work-card:hover .work-card__media img { transform: scale(1.04); }
.work-card__body { display: flex; flex: 1; flex-direction: column; gap: 0.5rem; padding: 1rem; }
.work-card__title { font-size: 1.25rem; }
.work-card__en { margin-top: -0.25rem; font-size: 0.75rem; letter-spacing: 0.18em; color: var(--muted); }
.work-card__summary {
  color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ═════════════ Spotlight ═════════════ */
.spotlight { margin-top: 2rem; display: grid; gap: 1.5rem; }
.spotlight__media-link { display: block; }
.spotlight__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface); }
.spotlight__media img { transition: transform 0.7s; }
.spotlight__media-link:hover .spotlight__media img { transform: scale(1.03); }
.spotlight__bar { position: absolute; inset: 0 auto 0 0; width: 0.375rem; background: var(--accent); }
.spotlight__media .badge-sample.is-corner { right: 1rem; top: 1rem; }
.spotlight__info { display: flex; flex-direction: column; gap: 1rem; }
.spotlight__title { font-size: 1.875rem; }
.spotlight__en { margin-top: 0.5rem; }
.team-list { display: grid; gap: 0.25rem; border-left: 2px solid var(--line); padding-left: 1rem; }
.team-list dt { font-size: 0.75rem; }
.award-list { display: grid; gap: 0.25rem; }
.award-list li { display: flex; gap: 0.5rem; }
@media (min-width: 640px) {
  .spotlight__media { aspect-ratio: 16 / 9; }
  .spotlight__title { font-size: 2.25rem; }
}
@media (min-width: 1024px) {
  .spotlight { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2.5rem; }
  .spotlight__media-link { grid-column: span 8; }
  .spotlight__info { grid-column: span 4; justify-content: center; }
}

/* ═════════════ Explore by Major ═════════════ */
.doors { margin-top: 2rem; display: grid; gap: 1rem; }
.door { display: block; height: 100%; }
.door__frame { height: 100%; --frame: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.door:hover .door__frame, .door:focus-visible .door__frame { --frame: var(--accent); }
.door__inner {
  position: relative; display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem;
  background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--accent-fill) 22%, transparent)), var(--surface);
}
.door__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.door__title { margin-top: 0.5rem; font-size: 1.875rem; }
.door__arrow {
  margin-top: 0.25rem; display: grid; width: 2.75rem; height: 2.75rem; flex-shrink: 0; place-items: center;
  font-size: 1.25rem; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
  transition: transform 0.3s, background-color 0.3s;
}
.door:hover .door__arrow, .door:focus-visible .door__arrow { transform: translateX(4px); background: color-mix(in srgb, var(--accent-fill) 25%, transparent); }
.door__previews { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.door__preview { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); }
.door__count { margin-top: auto; font-family: var(--font-head); font-weight: 500; color: var(--accent); }
@media (min-width: 640px) { .door__inner { padding: 1.5rem; } }
@media (min-width: 1024px) { .doors { grid-template-columns: repeat(3, 1fr); } }
/* จอที่ใช้เมาส์: ตัวอย่างผลงานโผล่เมื่อ hover หรือโฟกัส — จอสัมผัสเห็นตลอด */
@media (hover: hover) and (min-width: 1024px) {
  .door__previews { opacity: 0.25; filter: grayscale(1); transform: translateY(8px); transition: opacity 0.4s, transform 0.4s, filter 0.4s; }
  .door:hover .door__previews, .door:focus-visible .door__previews { opacity: 1; filter: none; transform: none; }
}

/* ═════════════ Latest Works ═════════════ */
.filters { margin: 2rem -1rem 0; padding-inline: 1rem; }
.filter-row { align-items: center; }
.filter-group { display: flex; align-items: center; gap: 0.5rem; }
.filter-sep { margin-inline: 0.25rem; height: 1.5rem; width: 1px; background: var(--line); }
.filter-count { margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted); }
.chip {
  display: inline-flex; flex: none; min-height: 2.75rem; align-items: center; padding-inline: 1rem;
  font-family: var(--font-head); font-weight: 500; font-size: 0.9375rem; white-space: nowrap;
  color: var(--muted); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  --cut: 8px; transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--text); box-shadow: none; }
.chip[data-major][aria-pressed="true"] {
  color: var(--accent); background: color-mix(in srgb, var(--accent-fill) 22%, var(--bg)); box-shadow: inset 0 0 0 2px var(--accent);
}
.works-grid { margin-top: 1.5rem; display: grid; gap: 1rem; }
.empty-note { margin-top: 1.5rem; }
#latest .btn-block { margin-top: 2rem; }
@media (min-width: 640px) {
  .filters { margin-inline: 0; padding-inline: 0; }
  .filter-row { flex-wrap: wrap; overflow: visible; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) { .works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ═════════════ Activities: timeline แนวตั้งชิดซ้าย ใช้เส้นหนาหักมุมฉากตามโลโก้ ═════════════ */
.act-timeline { position: relative; margin-top: 2.5rem; display: grid; gap: 2.5rem; padding-left: 2rem; }
.act-timeline::before {
  content: ""; position: absolute; left: 0.4375rem; top: 0.5rem; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--sky), var(--indigo) 50%, var(--teal));
}
.act-item { position: relative; }
.act-dot { position: absolute; left: -2rem; top: 0.45rem; width: 18px; height: 18px; background: var(--bg); box-shadow: inset 0 0 0 4px var(--sky); }
.act-item:first-child .act-dot { background: var(--spark); box-shadow: 0 0 0 4px var(--bg), 0 0 16px 2px color-mix(in srgb, var(--spark) 60%, transparent); }
.act-card { display: grid; gap: 1rem; }
.act-date { font-family: var(--font-head); font-weight: 500; color: var(--sky); }
.act-title { margin-top: 0.25rem; font-size: 1.5rem; }
.act-loc { margin-top: 0.25rem; display: flex; gap: 0.5rem; }
.act-summary { margin-top: 0.75rem; max-width: 42rem; }
.act-sample { margin-top: 0.75rem; }
.act-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
@media (min-width: 768px) {
  .act-timeline { padding-left: 3rem; }
  .act-dot { left: -3rem; }
  .act-card { grid-template-columns: 1fr 18rem; gap: 2rem; }
}

/* ═════════════ Hall of Fame ═════════════ */
.hof-wrap { margin-top: 2rem; }
.hof-row { margin-inline: -1rem; gap: 1rem; padding: 0 1rem 0.5rem; }
.hof-item { width: 82vw; max-width: 22rem; }
.hof-card { height: 100%; --frame: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.hof-card__inner { position: relative; display: flex; flex-direction: column; gap: 0.75rem; padding: 1.25rem; }
.hof-card__top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.hof-card__trophy { width: 2.25rem; height: 2.25rem; color: var(--accent); }
.hof-card__year { font-family: var(--font-head); }
.hof-card__title { font-size: 1.25rem; }
.hof-card__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.hof-card__work { font-weight: 500; }
.hof-card__work:hover { color: var(--accent); }
@media (min-width: 768px) { .hof-row { margin-inline: 0; padding-inline: 0; } }

/* ═════════════ Submit Your Spark ═════════════ */
.submit { position: relative; overflow: hidden; padding-block: 5rem; }
.submit__glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(40% 55% at 50% 100%, color-mix(in srgb, var(--spark) 22%, transparent), transparent 70%),
    radial-gradient(30% 40% at 15% 20%, color-mix(in srgb, var(--sky) 12%, transparent), transparent 70%),
    radial-gradient(30% 40% at 85% 25%, color-mix(in srgb, var(--teal) 12%, transparent), transparent 70%);
}
.submit__wrap { position: relative; }
.submit__inner { margin-inline: auto; max-width: 48rem; text-align: center; }
.submit__title { margin-top: 0.5rem; font-size: 2.25rem; }
.grad-underline { background: var(--grad-cmd) left bottom / 100% 6px no-repeat; padding-bottom: 0.1em; }
.submit__lead { margin: 1.25rem auto 0; max-width: 36rem; }
.submit__actions { margin: 2rem auto 0; display: flex; flex-direction: column; gap: 0.75rem; max-width: 28rem; }
.submit__cta { width: 100%; font-size: 1.125rem; }
.submit__alt { width: 100%; }
@media (min-width: 640px) {
  .submit { padding-block: 7rem; }
  .submit__title { font-size: 3.75rem; }
  .submit__actions { max-width: none; flex-direction: row; justify-content: center; }
  .submit__cta { width: auto; min-width: 14rem; }
  .submit__alt { width: auto; }
}

/* ═════════════ หน้าชั่วคราว (กำลังจัดทำ) ═════════════ */
.coming {
  display: flex; min-height: 70dvh; flex-direction: column; justify-content: center; gap: 1.5rem;
  padding-top: calc(var(--header-h) + 3rem); padding-bottom: 4rem;
}
.coming > .btn { align-self: flex-start; }
.coming__title { margin-top: 0.25rem; font-size: 2.25rem; }
.coming__note { max-width: 36rem; }
.coming__lead { max-width: 42rem; }
.coming__media { aspect-ratio: 16 / 9; max-width: 48rem; overflow: hidden; background: var(--surface); }
.major-links { display: grid; gap: 0.5rem; }
@media (min-width: 640px) {
  .coming__title { font-size: 3rem; }
  .major-links { grid-template-columns: repeat(3, 1fr); }
}

/* ═════════════ หน้าต่าง (dialog) ═════════════ */
.dialog-card { --frame: var(--teal); }
.dialog-card__inner { padding: 1.5rem; }
.dialog-card__title { margin-top: 0.25rem; font-size: 1.5rem; }
.dialog-card__inner > .muted { margin-top: 0.75rem; }
.dialog-card__actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ═════════════ เผยเนื้อหาตอนเลื่อน: เฉพาะเมื่อมี JS และไม่ได้ตั้ง reduced motion ═════════════ */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

/* ปุ่มเข้าสู่ระบบ / หลังบ้านในแถบเมนู */
.nav-account {
  margin-left: 0.25rem; display: inline-flex; min-height: 2.5rem; align-items: center; padding-inline: 0.875rem;
  font-family: var(--font-head); font-weight: 500; font-size: 0.875rem; color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.nav-account:hover { box-shadow: inset 0 0 0 1px var(--sky); }

/* สถิติการเข้าชม */
.footer-stats { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; }
.footer-stats__label { font-family: var(--font-head); font-weight: 300; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.75rem; }
.footer-stats b { font-family: var(--font-head); font-weight: 600; color: var(--text); }
.footer-bottom__row { flex-wrap: wrap; }
.view-count { display: inline-flex; gap: 0.5rem; align-items: center; font-size: 0.875rem; color: var(--muted); }
.view-count span { color: var(--accent); }

/* แจ้งปัญหาผลงาน (หน้าผลงาน) */
.report { margin-top: 1rem; max-width: 42rem; font-size: 0.9375rem; }
.report summary { cursor: pointer; color: var(--muted); min-height: 2.75rem; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.report__form { display: grid; gap: 0.75rem; margin-top: 0.75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); }
.report__field { display: grid; gap: 0.375rem; color: var(--muted); }
.report__field select, .report__field textarea, .report__field input {
  width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 0;
}
.report__form .btn { justify-self: start; }
.report__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.report__done { margin-top: 0.5rem; color: var(--teal-bright); }

/* ═════════════ หน้าสาธารณะ (ขั้น 4) ═════════════ */
.page-top { padding-top: calc(var(--header-h) + 2.5rem); }
.page-top > .section, .page-top .section:first-child { padding-top: 0; }
.chip[aria-current="true"], .chip[aria-current="page"] { color: var(--bg); background: var(--text); box-shadow: none; }
.chip[data-major][aria-current="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent-fill) 22%, var(--bg)); box-shadow: inset 0 0 0 2px var(--accent); }
.filters--static { margin-top: 1rem; }
.link-reset { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
.empty-state { margin-top: 2rem; display: grid; gap: 1rem; justify-items: start; padding: 2rem; background: var(--surface); border: 1px dashed var(--line); }
.pager-public { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 2rem; }
.pager-public__gap { padding-inline: 0.25rem; color: var(--muted); }
.pager-public__info { margin-top: 0.75rem; font-size: 0.875rem; }

/* ค้นหา */
.search-bar { display: flex; gap: 0.5rem; margin-top: 1.75rem; max-width: 36rem; }
.search-bar__input {
  flex: 1; min-width: 0; min-height: 3rem; padding: 0 1rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 0; font-size: 1rem;
}
.search-bar__input:focus { outline: none; border-color: var(--sky); }

/* แถบหัวของหน้าสาย */
.major-banner { position: relative; overflow: hidden; padding: calc(var(--header-h) + 3rem) 0 3rem; border-bottom: 1px solid var(--line); }
.major-banner__glow {
  position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 85% 10%, color-mix(in srgb, var(--accent-fill) 35%, transparent), transparent 70%);
}
.major-banner__inner { position: relative; }
.major-banner__title { margin-top: 0.5rem; font-size: clamp(2.5rem, 9vw, 5rem); line-height: 1.05; }
.major-banner__lead { margin-top: 1rem; max-width: 40rem; font-size: 1.0625rem; }
.major-banner__count { margin-top: 1rem; color: var(--muted); }
.major-banner__count b { font-family: var(--font-head); color: var(--accent); font-size: 1.5rem; }
.major-banner__others { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1.5rem; }
.major-banner__others a { min-height: 2.75rem; display: inline-flex; align-items: center; gap: 0.375rem; font-family: var(--font-head); color: var(--accent); }
.major-banner + .section { padding-top: 3rem; }

/* หน้าผลงาน */
.work-media { padding-top: calc(var(--header-h) + 1.25rem); }
.crumbs { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; font-size: 0.875rem; color: var(--muted); }
.crumbs a { min-height: 2.75rem; display: inline-flex; align-items: center; }
.crumbs a:hover { color: var(--text); }
.work-media__frame { position: relative; aspect-ratio: 16 / 9; width: min(100%, calc(68vh * 16 / 9)); margin-inline: auto; overflow: hidden; background: var(--surface); }
.work-media__frame img, .work-media__frame picture { width: 100%; height: 100%; object-fit: cover; }
.work-media__frame .badge-sample.is-corner { right: 1rem; top: 1rem; z-index: 1; }

/* สื่อไม่พร้อมแสดง (ผู้ดูแลปิดวิดีโอ/ภาพปก) */
.media-unavailable {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 0.375rem; padding: 1.5rem; text-align: center;
  color: var(--muted);
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--line) 70%, transparent) 0 2px, transparent 2px 18px),
    var(--surface);
}
.media-unavailable__icon { font-size: 2.5rem; line-height: 1; color: color-mix(in srgb, var(--accent) 70%, var(--muted)); }
.media-unavailable__title { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.125rem, 3vw, 1.5rem); color: var(--text); }
.media-unavailable__sub { font-size: 0.875rem; }
.media-unavailable--sm .media-unavailable__icon { font-size: 1.75rem; }
.media-note {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 1; display: inline-flex; gap: 0.5rem; align-items: center;
  padding: 0.375rem 0.875rem; font-family: var(--font-head); font-weight: 500; font-size: 0.9375rem;
  color: var(--text); background: color-mix(in srgb, var(--bg) 82%, transparent); box-shadow: inset 0 0 0 1px var(--line);
}
.yt-facade { position: relative; display: block; width: 100%; height: 100%; }
.yt-facade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(6, 7, 11, 0.55), transparent 50%); }
.yt-facade__play {
  position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%;
  display: grid; place-items: center; width: 5rem; height: 5rem; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text);
  box-shadow: 0 0 0 2px var(--accent), 0 0 40px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: transform 0.2s;
}
.yt-facade__play svg { width: 2rem; height: 2rem; margin-left: 0.25rem; }
.yt-facade:hover .yt-facade__play, .yt-facade:focus-visible .yt-facade__play { transform: scale(1.08); }
.yt-facade__label { position: absolute; left: 1rem; bottom: 1rem; z-index: 1; font-family: var(--font-head); font-weight: 500; }
.yt-frame { width: 100%; height: 100%; border: 0; display: block; }

/* minmax(0, 1fr): ข้อความยาวที่ตัดไม่ได้ (เช่นลิงก์ Google Forms ในคำอธิบาย) ต้องไม่ดันคอลัมน์ให้กว้างเกินจอมือถือ */
.work-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-block: 2rem 3rem; }
@media (min-width: 1024px) { .work-layout { grid-template-columns: minmax(0, 1fr) 21rem; gap: 3.5rem; } }
.work-head__title { margin-top: 0.75rem; font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.15; }
.work-head__en { margin-top: 0.5rem; }
.work-head__summary { margin-top: 1rem; font-size: 1.125rem; max-width: 44rem; }
.work-section { margin-top: 2.5rem; }
.work-section__title { font-size: 1.25rem; padding-left: 0.875rem; border-left: 4px solid var(--accent); }
.prose { margin-top: 1rem; max-width: 44rem; display: grid; gap: 1rem; overflow-wrap: anywhere; }
.work-head__title, .work-head__en, .work-head__summary { overflow-wrap: anywhere; }
.gallery { margin-top: 1rem; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gallery__item { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
.gallery__item--poster { aspect-ratio: 3 / 4; }
.gallery__item img, .gallery__item picture { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gallery__item:hover img { transform: scale(1.04); }
.work-awards { margin-top: 1rem; display: grid; gap: 0.75rem; }
.work-awards li { --frame: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.work-awards__inner { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.25rem; }
.work-awards__icon { color: var(--accent); font-size: 1.5rem; line-height: 1; }
.work-awards__title { font-family: var(--font-head); font-weight: 600; }

.work-side { display: grid; gap: 1.25rem; align-content: start; }
@media (min-width: 1024px) { .work-side { position: sticky; top: calc(var(--header-h) + 1.5rem); } }
.artbook-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1.25rem;
  background: color-mix(in srgb, var(--accent-fill) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: background-color 0.2s;
}
.artbook-card:hover { background: color-mix(in srgb, var(--accent-fill) 24%, var(--surface)); }
.artbook-card__icon { display: grid; place-items: center; width: 3rem; height: 3.75rem; font-family: var(--font-head); font-weight: 600; font-size: 0.875rem; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.artbook-card__title { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; }
.artbook-card__meta { display: block; font-size: 0.875rem; color: var(--muted); }
.artbook-card__go { color: var(--accent); font-size: 1.25rem; }
.share { display: grid; gap: 0.625rem; }
.share__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share__btn {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.share__btn:hover, .share__btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.share__btn svg { width: 1.25rem; height: 1.25rem; }
.share__btn[hidden] { display: none; }
.share__status { min-height: 1.25rem; font-size: 0.875rem; }
.credits { padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); }
.credits__list { margin-top: 0.75rem; display: grid; gap: 0.625rem; }
.credits__row dt { font-size: 0.8125rem; color: var(--muted); font-family: var(--font-head); letter-spacing: 0.04em; }
.credits__row dd { font-weight: 500; }
.credits__email { display: block; margin-top: 0.125rem; font-size: 0.8125rem; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.credits__email:hover { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
.credits__block { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.credits__label { font-size: 0.8125rem; color: var(--muted); font-family: var(--font-head); font-weight: 500; }
.credits__block ul { margin-top: 0.375rem; display: grid; gap: 0.25rem; }
.credits__block .tool-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.tool-tags li { padding: 0.125rem 0.625rem; font-size: 0.875rem; box-shadow: inset 0 0 0 1px var(--line); }
.related { border-top: 1px solid var(--line); }

/* หน้าส่งผลงาน */
.steps { margin-top: 2rem; display: grid; gap: 1rem; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps__inner { padding: 1.5rem; }
.steps__no { font-family: var(--font-head); font-weight: 300; font-size: 2rem; color: var(--sky); }
.steps__title { margin-top: 0.25rem; font-size: 1.375rem; }
.steps__inner .muted { margin-top: 0.5rem; }
.checklist { margin-top: 1.5rem; --frame: color-mix(in srgb, var(--spark) 40%, var(--line)); }
.checklist__inner { padding: 1.5rem; }
.checklist__title { font-size: 1.25rem; }
.checklist ul { margin-top: 0.75rem; display: grid; gap: 0.5rem; }
.checklist li { position: relative; padding-left: 1.5rem; }
.checklist li::before { content: "✦"; position: absolute; left: 0; color: var(--spark); }
.submit-page__actions { margin-top: 2rem; display: grid; gap: 0.75rem; justify-items: start; }
.submit-page__actions .submit__cta { width: 100%; }
@media (min-width: 640px) { .submit-page__actions .submit__cta { width: auto; min-width: 18rem; } }

/* ═════════════ แถบขออนุญาตคุกกี้ (ด้านล่างจอ) ═════════════ */
.consent {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.35);
  animation: consent-in 0.35s ease-out both;
}
.consent.is-leaving { transition: translate 0.25s ease-in, opacity 0.25s; translate: 0 100%; opacity: 0; }
@keyframes consent-in { from { translate: 0 100%; } }
@media (prefers-reduced-motion: reduce) { .consent { animation: none; } .consent.is-leaving { transition: none; } }
.consent__inner { display: grid; gap: 0.75rem; padding-block: 1rem; }
.consent__title { font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; }
.consent__text p { margin-top: 0.25rem; font-size: 0.9375rem; }
.consent__link { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
.consent__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.consent__actions .btn { flex: 1 1 auto; }
.consent__accept { background: var(--text); color: var(--bg); }
.consent__accept:hover { background: #fff; }
@media (min-width: 768px) {
  .consent__inner { grid-template-columns: 1fr auto; align-items: center; gap: 2rem; }
  .consent__actions .btn { flex: 0 0 auto; }
}
.footer-privacy { text-decoration: underline; text-underline-offset: 3px; }
.footer-privacy:hover { color: var(--text); }
.privacy-list { display: grid; gap: 0.5rem; padding-left: 1.25rem; list-style: disc; }

/* ═════════════ กิจกรรม: ไทม์ไลน์ลิงก์ได้ · กลุ่มกำลังจะมาถึง/ที่ผ่านมา · หน้ากิจกรรม ═════════════ */
.act-card { position: relative; }
.act-title a:hover { color: var(--sky); }
.act-title a:focus-visible { outline: 2px solid var(--spark); outline-offset: 4px; }
.act-badge {
  display: inline-block; margin-left: 0.5rem; padding: 0.125rem 0.5rem; vertical-align: 0.1em;
  font-size: 0.75rem; letter-spacing: 0.04em; color: var(--bg); background: var(--spark);
}
.act-media .media-unavailable { position: static; height: 100%; }
.act-timeline--plain .act-item:first-child .act-dot { background: var(--bg); box-shadow: inset 0 0 0 4px var(--sky); }
.act-group + .act-group { margin-top: 4rem; }
.act-group__title { margin-top: 2.5rem; font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; }
.act-group__title + .act-timeline { margin-top: 1.5rem; }
.activity-page .act-date { margin-bottom: 0.5rem; }
.activity-page__draft { margin-bottom: 1rem; padding: 0.625rem 0.875rem; font-size: 0.9375rem; color: var(--spark); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--spark) 50%, var(--line)); }
.activity-page__draft a { text-decoration: underline; text-underline-offset: 3px; }
.page-top-sm { padding-top: calc(var(--header-h) + 1.5rem); }

/* ═════════════ แกลเลอรีแบบ popup (lightbox) ═════════════ */
.gallery[data-lightbox] .gallery__item { cursor: zoom-in; }
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(4, 5, 8, 0.94); color: var(--text); overflow: hidden;
}
.lightbox::backdrop { background: rgba(4, 5, 8, 0.6); }
.lightbox[open] { display: grid; place-items: center; animation: lightbox-in 0.18s ease-out; }
@keyframes lightbox-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lightbox[open] { animation: none; } }
.lightbox__figure { display: grid; justify-items: center; gap: 0.75rem; width: 100%; height: 100%; padding: 3.5rem 1rem 1rem; box-sizing: border-box; }
.lightbox__img {
  max-width: 100%; max-height: calc(100dvh - 7.5rem); object-fit: contain; align-self: center;
  touch-action: pan-y; user-select: none; -webkit-user-drag: none; transition: opacity 0.15s;
}
.lightbox__img.is-loading { opacity: 0.35; }
.lightbox__caption { display: flex; gap: 1rem; justify-content: center; align-items: baseline; max-width: 60rem; font-size: 0.9375rem; color: var(--muted); text-align: center; }
.lightbox__count { font-family: var(--font-head); white-space: nowrap; color: var(--text); }
.lightbox__btn {
  position: absolute; display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; cursor: pointer;
  font-size: 2rem; line-height: 1; color: var(--text); background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}
.lightbox__btn:hover, .lightbox__btn:focus-visible { background: var(--surface); color: var(--spark); }
.lightbox__btn[hidden] { display: none; }
.lightbox__close { top: 0.5rem; right: 0.5rem; }
.lightbox__prev, .lightbox__next { top: 50%; translate: 0 -50%; }
.lightbox__prev { left: 0.5rem; }
.lightbox__next { right: 0.5rem; }
@media (max-width: 639.98px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: 0.75rem; translate: none; }
}
.act-badge--pin { color: var(--text); background: color-mix(in srgb, var(--sky) 35%, var(--surface)); }

/* ═════════════ หน้ารวมรางวัล ═════════════ */
.awards-grid { margin-top: 2rem; display: grid; gap: 1rem; }
.awards-grid > li { display: grid; }
@media (min-width: 640px) { .awards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .awards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
