/* หน้าแรกสาธารณะ — ห้องเรียนดิจิทัล */
.hm {
  --navy: #0a1430; --navy-2: #10205200; --blue: #3b82f6; --cyan: #22d3ee; --violet: #8b5cf6;
  --ink: #0f172a; --muted: #5b6478; --rule: #e3e8f2; --soft: #f5f7fc;
  font-family: 'Sarabun', system-ui, sans-serif; color: var(--ink); background: #fff;
}
.hm h1, .hm h2, .hm h3, .hm .btn, .hm-btn, .hm-btn-ghost, .hm-join button { font-family: 'Prompt', 'Sarabun', sans-serif; }
.hm-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hm-skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 60; border-radius: 6px; }
.hm-skip:focus { left: 12px; }
.hm a:focus-visible, .hm button:focus-visible, .hm input:focus-visible, .hm select:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; box-shadow: none; }

/* ---------- ปุ่ม */
.hm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 500;
  background: linear-gradient(135deg, #2563eb, #06b6d4); box-shadow: 0 8px 24px -8px rgba(37,99,235,.7), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .15s, box-shadow .15s; }
.hm-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 30px -8px rgba(37,99,235,.8), inset 0 1px 0 rgba(255,255,255,.25); }
.hm-btn-sm { padding: 9px 18px; font-size: .95rem; }
.hm-btn-lg { padding: 14px 30px; font-size: 1.08rem; }
.hm-btn-ghost { display: inline-flex; align-items: center; border-radius: 12px; color: #e6ecff; text-decoration: none; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.04); font-weight: 500; }
.hm-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.08); }

/* ---------- แถบบน (ลอยบนภาพหลัก → ทึบเมื่อเลื่อน) */
.hm-top { position: fixed; inset: 0 0 auto; z-index: 40; color: #fff; transition: background .25s, box-shadow .25s; }
.hm-top.solid { background: rgba(10,20,48,.86); backdrop-filter: blur(14px); box-shadow: 0 1px 0 rgba(255,255,255,.08); }
.hm-top-in { display: flex; align-items: center; gap: 28px; height: 76px; }
.hm-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.hm-brand:hover { color: #fff; }
.hm-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex: none; background: linear-gradient(135deg, #2563eb, #06b6d4); box-shadow: 0 0 24px rgba(34,211,238,.45); }
.hm-logo-img { height: 46px; width: auto; max-width: 150px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 8px rgba(0,0,0,.3)); }
.hm-brand-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.hm-brand-t b { font: 600 1.08rem 'Prompt'; }
.hm-brand-t span { font-size: .86rem; color: rgba(230,236,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-nav { display: flex; gap: 24px; margin-left: auto; }
.hm-nav a { color: rgba(230,236,255,.78); text-decoration: none; font-size: .95rem; padding: 6px 0; }
.hm-nav a:hover { color: #fff; }

/* ---------- ภาพหลัก */
.hm-hero { position: relative; overflow: hidden; color: #fff; padding: 150px 0 110px; background: var(--navy); isolation: isolate; }
.hm-hero-bg { position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 420px at 12% 18%, rgba(37,99,235,.55), transparent 70%),
    radial-gradient(520px 420px at 88% 30%, rgba(139,92,246,.45), transparent 70%),
    radial-gradient(700px 360px at 60% 110%, rgba(6,182,212,.35), transparent 70%),
    linear-gradient(180deg, #0a1430, #0b1638 60%, #0a1430); }
.hm-hero-bg::before { content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148,180,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(148,180,255,.07) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%); mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%); }
.hm-hero.has-img .hm-hero-bg { background: linear-gradient(100deg, rgba(10,20,48,.95) 25%, rgba(10,20,48,.72) 55%, rgba(10,20,48,.55)), var(--hero) center/cover no-repeat, var(--navy); }
.hm-net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hm-net .lines path { fill: none; stroke: rgba(103,232,249,.28); stroke-width: 1; }
.hm-net .dots circle { fill: #67e8f9; filter: drop-shadow(0 0 6px #22d3ee); }
.hm-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 60px; background: linear-gradient(transparent, rgba(255,255,255,.04)); z-index: -1; }

.hm-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.hm-pill { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 7px 16px 7px 12px; border-radius: 999px; font-size: .95rem; color: #cfe3ff;
  background: rgba(255,255,255,.06); border: 1px solid rgba(148,180,255,.25); backdrop-filter: blur(6px); }
.hm-pulse { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: hm-pulse 2.4s infinite; }
@keyframes hm-pulse { 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.hm-title { font-weight: 600; font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1.1; margin: 0 0 22px; letter-spacing: -.015em;
  background: linear-gradient(100deg, #ffffff 30%, #a5f3fc 70%, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hm-lead { font-size: 1.15rem; line-height: 1.8; color: rgba(222,231,255,.8); max-width: 32em; margin: 0 0 32px; }
.hm-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.hm-cta .hm-btn-ghost { padding: 14px 26px; font-size: 1.08rem; }

.hm-join { max-width: 520px; }
.hm-join label { display: block; font-size: .95rem; color: #cfe3ff; margin-bottom: 8px; }
.hm-join-row { display: flex; gap: 6px; padding: 6px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(148,180,255,.28); backdrop-filter: blur(10px); }
.hm-join input { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; padding: 8px 12px; font: 500 1.1rem 'Prompt'; letter-spacing: .06em; }
.hm-join input::placeholder { color: rgba(207,227,255,.5); letter-spacing: 0; font-weight: 400; font-size: 1rem; }
.hm-join input:focus { outline: none; }
.hm-join-row:focus-within { border-color: rgba(103,232,249,.8); box-shadow: 0 0 0 4px rgba(34,211,238,.15); }
.hm-join button { border: 0; border-radius: 10px; padding: 10px 18px; color: var(--navy); font-weight: 600; background: #e0f7ff; white-space: nowrap; }
.hm-join button:hover { background: #fff; }


/* ---------- ส่วนเนื้อหา */
.hm-sec { padding: 92px 0; }
.hm-h2 { font-weight: 600; font-size: clamp(1.65rem, 3vw, 2.25rem); margin: 0 0 8px; letter-spacing: -.01em; }
.hm-sub { color: var(--muted); font-size: 1.05rem; margin: 0 0 40px; }
.hm-ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 10px 22px -10px var(--a); }

.hm-channels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.hm-channels.has3 { grid-template-columns: repeat(3, 1fr); }
.hm-ch { position: relative; padding: 30px; border-radius: 20px; border: 1px solid var(--rule); background: linear-gradient(180deg, #fff, #fafbff); display: flex; flex-direction: column; align-items: flex-start; }
.hm-ch .hm-ic { margin-bottom: 18px; }
.hm-ch h3 { font-size: 1.3rem; font-weight: 600; margin: 0 0 8px; }
.hm-ch p { color: var(--muted); line-height: 1.7; margin: 0 0 20px; max-width: 30em; flex: 1; }
.hm-link { font: 500 1rem 'Prompt'; color: #2563eb; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 2px solid rgba(37,99,235,.25); }
.hm-link:hover { color: #1d4ed8; border-bottom-color: #2563eb; }

/* สรุปการใช้งาน */
.hm-sum { background: var(--soft); }
.hm-sum-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.hm-term .form-select { min-width: 240px; border-radius: 12px; padding: 10px 40px 10px 14px; border-color: var(--rule); font-family: 'Prompt'; }
.hm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 24px; }
.hm-kpis > div { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--rule); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column-reverse; gap: 4px; }
.hm-kpis > div::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--a); }
.hm-kpis dt { font-weight: 400; color: var(--muted); font-size: .95rem; }
.hm-kpis dd { margin: 0; font: 600 2.1rem/1.1 'Prompt'; color: var(--ink); }
.hm-table-box { background: #fff; border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; }
.hm-table-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.hm-table-tools b { font: 500 1.05rem 'Prompt'; }
.hm-table-tools input { max-width: 280px; border-radius: 10px; }
.hm-table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.hm-table th { text-align: left; font: 500 .9rem 'Prompt'; color: var(--muted); background: #f8faff; padding: 12px 16px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.hm-table td { padding: 13px 16px; border-bottom: 1px solid #eef1f7; }
.hm-table tbody tr:hover td { background: #f8fbff; }
.hm-table tbody tr:last-child td { border-bottom: 0; }
.hm-table .n { width: 56px; color: var(--muted); }
.hm-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.hm-table .mono { font-variant-numeric: tabular-nums; color: #334155; white-space: nowrap; }
.hm-empty { text-align: center; color: var(--muted); padding: 40px 16px !important; }
.hm-pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: .9rem; color: var(--muted); }
.hm-pager span { margin-right: 8px; }
.hm-pager button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--rule); background: #fff; }
.hm-pager button:disabled { opacity: .4; }

.hm-feats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 44px; }
.hm-feats li { display: flex; gap: 18px; align-items: flex-start; }
.hm-feats h3 { font-size: 1.12rem; font-weight: 600; margin: 4px 0 6px; }
.hm-feats p { margin: 0; color: var(--muted); line-height: 1.7; }

.hm-start { background: linear-gradient(180deg, var(--soft), #fff); }
.hm-steps { list-style: none; counter-reset: st; padding: 0; margin: 36px 0 36px; display: grid; grid-template-columns: repeat(3, 1fr); }
.hm-steps li { counter-increment: st; position: relative; padding-right: 32px; }
.hm-steps li::before { content: counter(st); display: block; font: 600 3.6rem/1 'Prompt'; margin-bottom: 14px;
  background: linear-gradient(135deg, #2563eb, #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hm-steps li:not(:last-child)::after { content: ''; position: absolute; top: 1.8rem; left: 3.4rem; right: 32px; height: 2px; background: linear-gradient(90deg, rgba(37,99,235,.35), rgba(6,182,212,0)); }
.hm-steps h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 6px; }
.hm-steps p { color: var(--muted); line-height: 1.7; margin: 0; max-width: 24em; }

/* ---------- ท้ายหน้า */
.hm-foot { background: var(--navy); color: rgba(222,231,255,.72); padding: 52px 0 24px; }
.hm-foot-in { display: flex; flex-wrap: wrap; gap: 28px 60px; justify-content: space-between; }
.hm-foot-brand { font: 600 1.15rem 'Prompt'; color: #fff; margin-bottom: 8px; }
.hm-foot-contact { line-height: 1.8; max-width: 40em; }
.hm-foot-links { display: flex; flex-direction: column; gap: 8px; }
.hm-foot a { color: #fff; text-decoration: none; }
.hm-foot a:hover { color: #a5f3fc; }
.hm-copy { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }

/* ---------- จอเล็ก */
@media (max-width: 991.98px) {
  .hm-nav { display: none; }
  .hm-top .hm-btn { margin-left: auto; }
  .hm-hero { padding: 120px 0 70px; }
  .hm-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hm-stage { min-height: 0; max-width: 520px; width: 100%; margin: 0 auto; }
  .hm-channels, .hm-channels.has3 { grid-template-columns: 1fr; }
  .hm-kpis { grid-template-columns: repeat(2, 1fr); }
  .hm-feats { grid-template-columns: 1fr 1fr; }
  .hm-steps { grid-template-columns: 1fr; gap: 28px; }
  .hm-steps li::after { display: none; }
  .hm-sec { padding: 64px 0; }
}
@media (max-width: 575.98px) {
  .hm-wrap { padding: 0 16px; }
  .hm-top-in { height: 64px; gap: 12px; }
  .hm-brand-t span { display: none; }
  .hm-hero { padding-top: 100px; }
  .hm-lead { font-size: 1.05rem; }
  .hm-cta .hm-btn-lg, .hm-cta .hm-btn-ghost { flex: 1; padding: 13px 16px; font-size: 1rem; }
  .hm-join-row { flex-wrap: wrap; }
  .hm-join button { width: 100%; }
  .hm-feats { grid-template-columns: 1fr; }
  .hm-kpis dd { font-size: 1.7rem; }
  .hm-table-tools input { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .hm-side-img, .hm-pulse { animation: none; } .hm-btn { transition: none; } }

/* ปรับละเอียด */
/* ภาพประกอบด้านขวา (อัปโหลดได้ที่ ตั้งค่าระบบ) */
.hm-hero-grid.no-side { grid-template-columns: minmax(0, 1fr); }
.hm-hero-grid.no-side .hm-hero-text { max-width: 760px; }
.hm-stage { position: relative; display: grid; place-items: center; min-height: 360px; }
.hm-orb { position: absolute; inset: 8% 10%; border-radius: 50%; background: conic-gradient(from 200deg, #2563eb, #06b6d4, #8b5cf6, #2563eb); filter: blur(70px); opacity: .45; }
.hm-side-img { position: relative; max-width: 100%; max-height: 520px; object-fit: contain; border-radius: 22px; filter: drop-shadow(0 30px 50px rgba(0,0,0,.45)); animation: hm-rise .9s .15s cubic-bezier(.2,.7,.2,1) both; }
@keyframes hm-rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.hm-net { -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 38%, #000 62%); mask-image: linear-gradient(90deg, transparent 0%, transparent 38%, #000 62%); }
.hm-sec, .hm-hero { scroll-margin-top: 80px; }
@media (max-width: 991.98px) { .hm-net { -webkit-mask-image: linear-gradient(180deg, transparent 45%, #000 70%); mask-image: linear-gradient(180deg, transparent 45%, #000 70%); } }
@media (max-width: 575.98px) { .hm-cta .hm-btn-lg, .hm-cta .hm-btn-ghost { flex: 1 1 100%; } }
