/* ===================================================================
   Landing page (/) — ThinkVerse AI learning portal
   ใช้โทเคนจาก styles.css ทุกคลาสขึ้นต้น hm- จึงไม่ชนกับหน้าอื่น
   =================================================================== */

.hm-body { background: var(--bg); }

.hm-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  padding: 12px 18px;
  background: white;
  color: var(--primary-700);
  border-radius: 0 0 var(--r-md) 0;
  font-size: 14px;
  font-weight: 600;
}
.hm-skip:focus { left: 0; text-decoration: none; }

/* =============== hero =============== */

.hm-hero {
  position: relative;
  min-height: 94vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  color: var(--text-on-dark);
  overflow: hidden;
}

/* ภาพวงโคจรที่สร้างด้วย Gemini วางเป็นชั้นลึกสุด จางลงตรงกลางเพื่อไม่แย่งความสนใจ
   จากตัวหนังสือ และไม่ให้ชนกับวงโคจรเวกเตอร์ที่หมุนอยู่ด้านหน้า */
.hm-hero__photo {
  position: absolute;
  inset: 0;
  background: url("/static/images/gen/hero.jpg") center/cover no-repeat;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, transparent 8%, #000 78%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, transparent 8%, #000 78%);
  animation: hmPhotoIn 2.2s ease-out backwards;
}
@keyframes hmPhotoIn {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 0.5; }
}

.hm-hero__aurora {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 52% at 20% 8%, rgba(99, 102, 241, 0.40) 0%, transparent 62%),
    radial-gradient(44% 42% at 84% 14%, rgba(251, 146, 60, 0.16) 0%, transparent 60%),
    radial-gradient(74% 64% at 50% 104%, rgba(79, 70, 229, 0.34) 0%, transparent 66%);
  animation: hmBreathe 16s ease-in-out infinite;
}
@keyframes hmBreathe {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.04); }
}

/* ดาวสามขนาด โปร่งพอให้อ่านเป็นความลึก ไม่ใช่ลวดลาย */
.hm-hero__stars {
  position: absolute;
  inset: -10%;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 22%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 16%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1.8px 1.8px at 62% 62%, rgba(255,255,255,0.40), transparent 60%),
    radial-gradient(1.1px 1.1px at 33% 74%, rgba(255,255,255,0.40), transparent 60%),
    radial-gradient(1.4px 1.4px at 88% 68%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1px 1px at 45% 34%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1.3px 1.3px at 22% 52%, rgba(199,210,254,0.45), transparent 60%),
    radial-gradient(1.1px 1.1px at 68% 88%, rgba(255,255,255,0.30), transparent 60%);
  animation: hmDrift 42s ease-in-out infinite alternate;
}
@keyframes hmDrift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-18px, 14px, 0); }
}

/* ของประดับชิ้นเดียวของหน้า: ThinkVerse = Think + Universe */
.hm-orbit {
  --hm-shift: 0px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(105vw, 1000px);
  height: min(105vw, 1000px);
  transform: translate(-50%, calc(-46% + var(--hm-shift)));
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 92%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 92%);
  animation: hmOrbitIn 1.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
@keyframes hmOrbitIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.82); }
  to   { opacity: 1; }
}

.hm-orbit__ring {
  fill: none;
  stroke: rgba(165, 180, 252, 0.20);
  stroke-width: 1;
}
.hm-orbit__dot { fill: rgba(199, 210, 254, 0.75); }
.hm-orbit__spin {
  transform-origin: 450px 450px;
  animation: hmSpin 150s linear infinite;
}
@keyframes hmSpin { to { transform: rotate(360deg); } }

/* จุดที่วิ่งไปตามวงโคจร ทำให้ hero มีชีวิตโดยไม่รบกวนการอ่าน */
.hm-comet { fill: #fed7aa; }
.hm-comet--indigo { fill: #c7d2fe; }
.hm-comet__glow { opacity: 0.75; }
#hmPathA, #hmPathB { fill: none; stroke: none; }

.hm-nav {
  position: sticky;
  top: 0;
  z-index: 6;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.hm-nav--solid {
  background: rgba(14, 10, 38, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.hm-hero__content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 32px 28px;
  max-width: 900px;
  margin: 0 auto;
}

.hm-hero__title {
  /* ไทยมีสระและวรรณยุกต์ซ้อนบนบรรทัด ต้องการช่องไฟมากกว่าหัวเรื่องภาษาอังกฤษ */
  font-size: clamp(32px, 5.6vw, 64px);
  font-weight: 700;
  line-height: 1.26;
  letter-spacing: -0.02em;
  color: white;
  margin: 0 0 24px;
  text-wrap: balance;
}

.hm-grad {
  background: linear-gradient(115deg, #c7d2fe 0%, #a5b4fc 38%, #fb923c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hm-hero__sub {
  font-size: clamp(15.5px, 1.7vw, 18px);
  line-height: 1.8;
  color: var(--text-on-dark-muted);
  max-width: 620px;
  margin: 0 0 28px;
}

/* ชิปสามแทร็ก ทำหน้าที่เป็นสารบัญของหน้าไปในตัว */
.hm-tracks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.hm-track {
  font-size: 13.5px;
  color: var(--text-on-dark-muted);
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.18s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hm-track:hover {
  color: white;
  border-color: rgba(165, 180, 252, 0.55);
  background: rgba(99, 102, 241, 0.20);
  text-decoration: none;
  transform: translateY(-1px);
}

.hm-cta { margin-bottom: 30px; }
.hm-cta:hover { text-decoration: none; }

.hm-motto {
  margin: 0;
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #c7d2fe;
  opacity: 0.85;
}

.hm-hero__foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding-bottom: 36px;
}
.hm-hero__scrollline {
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, transparent, rgba(199, 210, 254, 0.55));
  animation: hmLine 2.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hmLine {
  0%, 100% { transform: scaleY(0.55); opacity: 0.45; }
  50%      { transform: scaleY(1);    opacity: 1; }
}

/* =============== โครงร่วมของทุกส่วน =============== */

.hm-section { padding: 100px 32px; }

.hm-wrap {
  max-width: 1120px;
  margin: 0 auto;
}

/* JetBrains Mono ไม่มีตัวอักษรไทย และไทยเสียรูปคำเมื่อถูกยืดช่องไฟ
   จึงสงวนฟอนต์ mono ไว้ให้ข้อความละตินและตัวเลขเท่านั้น */
.hm-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary-600);
  margin-bottom: 12px;
}
.hm-eyebrow--dark { color: #a5b4fc; }
.hm-eyebrow--hero {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-on-dark-muted);
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  margin-bottom: 30px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hm-h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
}
.hm-h2--dark { color: white; }

.hm-secthead {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: end;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.hm-secthead__lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-muted);
}
.hm-secthead__lead--dark { color: var(--text-on-dark-muted); }

/* =============== หลักสูตร =============== */

.hm-courses { background: var(--bg); }

.hm-track-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 56px 0 22px;
  scroll-margin-top: 90px;
}
.hm-track-head:first-of-type { margin-top: 0; }
.hm-track-head__img {
  width: 74px;
  height: 74px;
  flex: none;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  background: var(--bg-deep);
}
.hm-track-head__no {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--primary-100);
  letter-spacing: -0.02em;
}
.hm-track-head__name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 3px;
  letter-spacing: -0.01em;
}
.hm-track-head__for {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-soft);
}

.hm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.hm-course {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
/* เส้นสีคือสิ่งเดียวที่โผล่มาตอน hover ให้รู้ว่ากำลังอ่านใบไหน */
.hm-course::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--primary-500), var(--accent));
  transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.hm-course:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--primary-100);
}
.hm-course:hover::before { width: 100%; }
.hm-course--wide { grid-column: span 2; }

/* สองคอร์สที่เป็นจุดขายของรอบนี้ ให้พื้นหลังต่างเล็กน้อยพอสังเกตได้ */
.hm-course--star {
  background: linear-gradient(180deg, var(--primary-50) 0%, var(--bg-elevated) 62%);
  border-color: var(--primary-100);
}

.hm-lv {
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
  white-space: nowrap;
}
.hm-lv--1 { background: var(--primary-50); color: var(--primary-700); }
.hm-lv--2 { background: #fff7ed; color: var(--accent-600); }
.hm-lv--3 { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-600) 100%); color: #fff; }
.hm-lv--exec { background: var(--bg-tint); color: var(--text-muted); }

.hm-course__name {
  font-size: 18.5px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.hm-course__desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-muted);
}
.hm-course__note {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft);
}
.hm-course__link {
  margin-top: 14px;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-600);
  text-decoration: none;
}
.hm-course__link span { display: inline-block; transition: transform 0.18s ease; }
.hm-course__link:hover { text-decoration: none; }
.hm-course__link:hover span { transform: translateX(4px); }

/* =============== รูปแบบการอบรม =============== */

.hm-formats {
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}
.hm-formats::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 56% at 88% 4%, rgba(251, 146, 60, 0.11) 0%, transparent 62%),
    radial-gradient(56% 60% at 4% 96%, rgba(99, 102, 241, 0.20) 0%, transparent 64%);
  pointer-events: none;
  z-index: 1;
}
/* ภาพเนบิวลาเป็นฉากหลังของแถบนี้ จางพอให้ตัวหนังสือขาวอ่านง่าย */
.hm-formats__photo {
  position: absolute;
  inset: 0;
  background: url("/static/images/gen/band.jpg") center/cover no-repeat;
  opacity: 0.42;
}
.hm-formats .hm-wrap { position: relative; z-index: 2; }
.hm-formats .hm-secthead { border-bottom-color: rgba(255, 255, 255, 0.10); }

.hm-formats__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.hm-format {
  margin: 0;
  padding: 4px 24px 4px 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 22px;
}
.hm-format:first-child { border-left: none; padding-left: 0; }
.hm-format__name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin: 0 0 8px;
}
.hm-format__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-on-dark-muted);
}

/* =============== เกี่ยวกับเรา =============== */

.hm-about { background: var(--bg-soft); }
.hm-about__grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hm-about__body {
  margin: 0;
  font-size: 16px;
  line-height: 1.95;
  color: var(--text-muted);
}
.hm-about__fig { margin: 0; }
.hm-about__fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--sh-lg);
}

/* =============== ติดต่อ =============== */

.hm-contact {
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}
.hm-contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 60% at 86% 0%, rgba(251, 146, 60, 0.12) 0%, transparent 62%),
    radial-gradient(58% 62% at 4% 100%, rgba(99, 102, 241, 0.22) 0%, transparent 64%);
  pointer-events: none;
}
.hm-contact__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  align-items: center;
}
.hm-contact__lead {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-on-dark-muted);
  max-width: 480px;
}

.hm-contact__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 320px;
}
.hm-contact__item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  color: white;
  text-decoration: none;
  transition: border-color 0.2s ease;
}
.hm-contact__item:first-child { border-top: 1px solid rgba(255, 255, 255, 0.10); }
.hm-contact__item:hover {
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.hm-contact__item:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 3px;
}
.hm-contact__label {
  flex: none;
  width: 62px;
  font-size: 13px;
  color: var(--text-soft);
}
.hm-contact__value {
  font-family: var(--font-mono);
  font-size: 15.5px;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.hm-contact__item:hover .hm-contact__value { color: #fdba74; }

/* =============== footer =============== */

.hm-footer { padding: 48px 32px 28px; }
.hm-footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hm-footer__logo {
  height: 46px;
  width: auto;
  border-radius: 8px;
  display: block;
}
.hm-footer__tag {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

/* =============== การเคลื่อนไหว =============== */

/* ลำดับการเข้าของ hero ทำครั้งเดียวตอนโหลด */
.hm-hero__content > * {
  animation: hmRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.hm-hero__content > *:nth-child(1) { animation-delay: 0.10s; }
.hm-hero__content > *:nth-child(2) { animation-delay: 0.20s; }
.hm-hero__content > *:nth-child(3) { animation-delay: 0.30s; }
.hm-hero__content > *:nth-child(4) { animation-delay: 0.40s; }
.hm-hero__content > *:nth-child(5) { animation-delay: 0.50s; }
.hm-hero__content > *:nth-child(6) { animation-delay: 0.60s; }

@keyframes hmRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* scroll reveal — ซ่อนไว้เฉพาะเมื่อสคริปต์ทำงาน (คลาส js-reveal ตั้งไว้ใน head) */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.js-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .hm-hero__content > * { animation: none; }
  .hm-hero__photo { animation: none; }
  .hm-orbit,
  .hm-orbit__spin,
  .hm-hero__aurora,
  .hm-hero__stars,
  .hm-hero__scrollline { animation: none; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hm-course,
  .hm-course::before,
  .hm-track,
  .hm-contact__item,
  .hm-contact__value,
  .hm-course__link span { transition: none; }
  .hm-course:hover { transform: none; }
  .hm-track:hover { transform: none; }
}

/* =============== responsive =============== */

@media (max-width: 1080px) {
  .hm-grid { grid-template-columns: repeat(2, 1fr); }
  .hm-course--wide { grid-column: span 2; }
  .hm-formats__list { grid-template-columns: repeat(2, 1fr); row-gap: 30px; }
  .hm-format:nth-child(3) { border-left: none; padding-left: 0; }
}

@media (max-width: 980px) {
  .hm-hero { min-height: 0; }
  .hm-hero__content { padding: 26px 24px 20px; }
  .hm-hero__foot { padding-bottom: 30px; }
  .hm-section { padding: 68px 24px; }

  .hm-secthead {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
    padding-bottom: 30px;
    margin-bottom: 32px;
  }
  .hm-track-head { margin: 44px 0 18px; }

  .hm-contact__inner { grid-template-columns: 1fr; gap: 32px; }
  .hm-contact__links { min-width: 0; }
  .hm-about__grid { grid-template-columns: 1fr; gap: 28px; }
  .hm-track-head__img { width: 60px; height: 60px; border-radius: 15px; }
}

@media (max-width: 700px) {
  .hm-grid { grid-template-columns: 1fr; }
  .hm-course--wide { grid-column: span 1; }
  .hm-formats__list { grid-template-columns: 1fr; row-gap: 26px; }
  .hm-format,
  .hm-format:nth-child(3) { border-left: none; padding-left: 0; }
}

@media (max-width: 540px) {
  .hm-orbit { width: 165vw; height: 165vw; }
  .hm-hero__sub { margin-bottom: 24px; }
  .hm-tracks { gap: 8px; margin-bottom: 26px; }
  .hm-track { font-size: 12.5px; padding: 7px 13px; }
  .hm-contact__item { gap: 10px; }
  .hm-contact__label { width: 48px; font-size: 12.5px; }
  .hm-contact__value { font-size: 14px; }
  .hm-footer__row { flex-direction: column; align-items: flex-start; }
}
