/*
 * องค์ประกอบร่วมรุ่นปัจจุบัน: ปุ่ม ภาษา navbar และ scroll storytelling
 */

/* Shared interaction rules. Load last so all five pages use the same controls. */
:root {
  --nav-height: 96px;
  --body-size: 18px;
  --body-leading: 1.8;
}
html {
  scroll-padding-top: calc(var(--nav-height) + 24px);
}
body {
  font-family: "Anuphan", sans-serif;
  overflow-x: clip;
}
main,
section,
article,
div {
  min-width: 0;
}
:is(html[lang="en"], html[lang="th"])
  body
  :is(
    p,
    .hero-copy > p:not(.eyebrow),
    .intro > p:last-child,
    .story-copy > p:not(.eyebrow),
    .page-hero > p:not(.eyebrow),
    .game-caption p,
    .process p,
    .core-options p,
    .credits > p:not(.eyebrow)
  ) {
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
:is(html[lang="en"], html[lang="th"]) body .eyebrow {
  font:
    500 11px/1.6 "Anuphan",
    sans-serif;
  letter-spacing: 0.13em;
}
:is(html[lang="en"], html[lang="th"])
  body
  :is(.small, .visual-caption, .comparison-note, .display-caption) {
  font:
    400 13px/1.6 "Anuphan",
    sans-serif;
}
h1,
h2,
h3 {
  overflow-wrap: anywhere;
  text-wrap: balance;
}
html[lang="th"] :is(h1, h2, h3) {
  line-height: 1.18;
  letter-spacing: -0.035em;
}
:is(button, .button, .text-link, .menu-button, .category-tab, .video-control) {
  border-radius: 999px;
}
body :is(.button, .text-link) {
  min-height: 52px;
  padding: 13px 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  font:
    600 16px/1.5 "Anuphan",
    sans-serif;
  text-align: center;
  border-radius: 999px;
}
body .button span {
  font-size: inherit;
  line-height: inherit;
}
body button {
  font-family: "Anuphan", sans-serif;
}
body .actions {
  gap: 14px;
  flex-wrap: wrap;
}
/* Both labels occupy the same grid cell; only the selected one is visible. */
[data-stable] {
  display: inline-grid;
  vertical-align: middle;
  min-width: 0;
}
[data-stable]::before,
[data-stable]::after,
[data-stable] > .i18n-value {
  grid-area: 1 / 1;
  white-space: inherit;
  line-height: inherit;
  font: inherit;
}
[data-stable]::before {
  content: attr(data-en);
  visibility: hidden;
  pointer-events: none;
}
[data-stable]::after {
  content: attr(data-th);
  visibility: hidden;
  pointer-events: none;
}
.site-header,
.site-header.is-scrolled {
  height: var(--nav-height);
  padding: 12px 108px 12px 40px;
  display: block;
  border: 0;
  transition:
    background 0.4s,
    box-shadow 0.4s,
    backdrop-filter 0.4s;
  background: linear-gradient(180deg, #100a0c99, transparent);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.site-header.is-scrolled {
  background: linear-gradient(120deg, #3b1b2594, #1a1b229e 50%, #26181e94);
  backdrop-filter: blur(24px) saturate(165%);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  box-shadow:
    inset 0 1px 0 #ffffff26,
    inset 0 -1px 0 #ffffff21,
    0 8px 32px #00000015;
}
.nav-shell {
  height: 100%;
  min-height: 0;
  padding: 0;
  max-width: 1460px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
}
.site-header .nav-side {
  gap: 6px;
  min-width: 0;
}
.site-header .nav-side a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 44px;
  padding: 10px 13px;
  font:
    600 14px/1.4 "Anuphan",
    sans-serif;
  border-radius: 999px;
  white-space: nowrap;
}
.site-header .nav-side a[aria-current]:after {
  display: none;
}
.site-header .nav-side a[aria-current],
.site-header .mobile-nav a[aria-current] {
  background: #ff343b12;
  color: #ff454b;
}
.site-header .nav-brand {
  min-width: 210px;
}
.site-header .brand-fallback > span:last-child {
  font-family: "Archivo Black", sans-serif;
  font-size: 16px;
  letter-spacing: -0.06em;
}
.site-header .brand-fallback small {
  height: 10px;
  font:
    500 8px/1.2 "Anuphan",
    sans-serif;
  letter-spacing: 0.13em;
}
.language-switch,
.site-header.is-scrolled .language-switch {
  left: auto;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  height: 42px;
  width: 74px;
  padding: 0 11px;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  background: #ffffff0c;
  border: 1px solid #ffffff33;
  font-size: 12px;
  line-height: 1;
  transition: background 0.2s;
}
.language-switch:hover {
  background: #ffffff20;
}
.language-code {
  width: 18px;
}
.flag {
  flex-shrink: 0;
}
.site-header .nav-side a:hover,
.site-header .mobile-nav a:hover {
  color: #ff454b;
  background: #ff343b14;
}
.site-header .nav-side a[href="corehex/"]:hover,
.site-header .mobile-nav a[href="corehex/"]:hover {
  color: #369eff;
  background: #1683ed12;
}
.site-header .nav-side a[href="corehex/"][aria-current]:not(:hover) {
  color: #ff454b;
  background: #ff343b12;
}
body .site-header .mobile-nav {
  background: linear-gradient(125deg, #311c29dd, #111722dd);
  backdrop-filter: blur(25px) saturate(165%);
  -webkit-backdrop-filter: blur(25px) saturate(165%);
  box-shadow:
    inset 0 1px 0 #ffffff26,
    0 20px 50px #0005;
  border: 1px solid #ffffff26;
  border-radius: 24px;
}
body .site-header .mobile-nav a {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font:
    600 16px/1.4 "Anuphan",
    sans-serif;
}
/* Scroll-led product presentation: content stays readable without JavaScript. */
.scroll-showcase {
  position: relative;
  min-height: 170svh;
}
.scene-sticky {
  position: sticky;
  top: var(--nav-height);
  min-height: calc(100svh - var(--nav-height));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 7%;
  padding: 55px 6%;
  max-width: 1600px;
  margin: auto;
}
.scene-copy h2 {
  font-size: clamp(36px, 4vw, 62px);
  line-height: 1.12;
  letter-spacing: -0.055em;
  margin-bottom: 24px;
}
.scene-intro {
  max-width: 520px;
  color: #648098;
}
.scene-steps {
  margin-top: 32px;
  display: grid;
  gap: 22px;
}
.scene-step {
  position: relative;
  padding-left: 20px;
  opacity: 0.42;
  transition:
    opacity 0.5s,
    transform 0.5s;
  transform: translateY(5px);
}
.scene-step.active {
  opacity: 1;
  transform: none;
}
.scene-step .step-line {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: currentColor;
  opacity: 0.2;
  border-radius: 999px;
}
.scene-step.active .step-line {
  background: #1683df;
  opacity: 1;
}
.scene-step h3 {
  font:
    600 20px/1.45 "Anuphan",
    sans-serif;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
:is(html[lang="en"], html[lang="th"]) body .scene-step p {
  font-size: 16px;
  line-height: 1.75;
}
.scene-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transform: translateY(calc(18px - var(--scene-progress, 0) * 18px))
    scale(calc(0.94 + var(--scene-progress, 0) * 0.06));
  will-change: transform;
}
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font:
    500 13px/1.5 "Anuphan",
    sans-serif;
  letter-spacing: 0.08em;
  color: #fff;
  margin-top: 48px;
}
.scroll-cue svg {
  width: 22px;
  height: 32px;
  animation: scroll-down 1.8s ease-in-out infinite;
}
@keyframes scroll-down {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}
@media (max-width: 1100px) {
  .site-header {
    padding-left: 20px;
  }
  .site-header.is-scrolled {
    padding-left: 20px;
  }
  .site-header .nav-side a {
    min-width: 75px;
    padding-inline: 8px;
  }
  .nav-shell {
    gap: 10px;
  }
  .scene-sticky {
    gap: 5%;
  }
}
@media (max-width: 960px) {
  :root {
    --nav-height: 82px;
  }
  .site-header,
  .site-header.is-scrolled {
    height: 82px;
    padding: 12px 100px 12px 22px;
  }
  .nav-shell {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
  }
  .site-header .nav-side {
    display: none;
  }
  .site-header .menu {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border-radius: 999px;
    background: #ffffff08;
    border: 1px solid #ffffff26;
  }
  .menu span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
  }
  .site-header .nav-brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    min-width: 0;
  }
  .site-header .mobile-nav {
    display: none;
    position: absolute;
    left: 4%;
    right: 4%;
    top: calc(100% + 8px);
    padding: 14px;
    gap: 4px;
    max-height: calc(100svh - 110px);
    overflow-y: auto;
    flex-direction: column;
  }
  .site-header .mobile-nav.open {
    display: flex;
  }
  .language-switch,
  .site-header.is-scrolled .language-switch {
    right: 16px;
    top: 50%;
  }
  .site-header .brand-image {
    max-height: 52px;
  }
  .scene-sticky {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}
@media (max-width: 700px) {
  :root {
    --body-size: 17px;
  }
  .site-header,
  .site-header.is-scrolled {
    padding-left: 12px;
    padding-right: 91px;
  }
  .nav-shell {
    gap: 8px;
  }
  .site-header .nav-brand .brand-fallback > span:last-child {
    font-size: 12px;
  }
  .site-header .studio-mark {
    width: 28px;
    height: 28px;
  }
  .site-header .brand-fallback {
    gap: 5px;
  }
  .site-header .brand-fallback small {
    font-size: 7px;
  }
  .language-switch,
  .site-header.is-scrolled .language-switch {
    right: 12px;
    width: 65px;
    gap: 5px;
    padding: 0 7px;
  }
  .flag {
    width: 21px;
    height: 14px;
  }
  .site-header .menu {
    width: 40px;
    height: 40px;
  }
  .site-header .brand-image {
    max-width: 145px;
  }
  .hero h1 {
    font-size: clamp(46px, 12vw, 69px);
  }
  .hero-copy {
    width: 100%;
  }
  .hero {
    min-height: 1000px;
    padding-top: 145px;
  }
  .hero h1 {
    line-height: 1.04;
  }
  .hero-copy > p {
    max-width: 36ch;
  }
  .page-hero h1 {
    font-size: clamp(40px, 10.5vw, 65px);
  }
  .story-copy h2 {
    font-size: 34px;
    min-height: 3.2em;
  }
  .story-copy > p:not(.eyebrow) {
    min-height: 6em;
  }
  .story-sticky {
    min-height: 880px;
  }
  body :is(.button, .text-link) {
    min-height: 50px;
    font-size: 15px;
    padding: 12px 22px;
  }
  .scroll-showcase {
    min-height: 0;
  }
  .scene-sticky {
    position: relative;
    top: 0;
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 60px 6%;
    gap: 42px;
  }
  .scene-copy h2 {
    font-size: 36px;
  }
  .scene-steps {
    gap: 24px;
  }
  .scene-step {
    opacity: 1;
    transform: none;
  }
  .scene-art {
    transform: translateY(calc(12px - var(--scene-progress, 0) * 12px))
      scale(calc(0.96 + var(--scene-progress, 0) * 0.04));
  }
  .scene-intro {
    max-width: none;
  }
  .scene-copy {
    order: 2;
  }
  .scene-art {
    order: 1;
  }
  .scroll-cue {
    margin-top: 34px;
  }
  .scene-step h3 {
    font-size: 21px;
  }
}
@media (max-width: 360px) {
  .site-header .nav-brand .brand-fallback > span:last-child {
    font-size: 10px;
  }
  .site-header .studio-mark {
    width: 22px;
    height: 22px;
  }
  .site-header .nav-brand {
    justify-self: start;
  }
  .nav-shell {
    gap: 4px;
    grid-template-columns: 40px 1fr;
  }
  .site-header .brand-image {
    max-width: 125px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .scroll-showcase {
    min-height: 0;
  }
  .scene-sticky {
    position: relative;
    top: 0;
    min-height: 0;
  }
  .scene-art {
    transform: none;
    will-change: auto;
  }
  .scene-step {
    opacity: 1;
    transform: none;
  }
  .js-motion .reveal {
    opacity: 1;
    transform: none;
  }
}

/* หน้าแรก: ให้หัวข้อ ปุ่ม และแถวเลื่อนลงจองพื้นที่ตามข้อความจริง */
.home-page .hero {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 32px;
  height: auto;
  min-height: 100svh;
  max-height: none;
  padding-bottom: 26px;
}
.home-page .hero-bottom {
  position: relative;
  inset: auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
}
html[lang="th"] .hero h1 {
  font-size: clamp(42px, 6.4vw, 98px);
  line-height: 1.18;
}
@media (max-width: 700px) {
  .home-page .hero {
    /* เว้นพื้นที่ภาพโลกเหนือแถวเลื่อนลง โดยให้ข้อความด้านบนขยายได้ */
    row-gap: 390px;
  }
  html[lang="th"] .hero h1 {
    font-size: clamp(40px, 10.5vw, 65px);
  }
}
