/* =====================================================================
   home.css — สไตล์ของหน้าแรก (index.html ที่โฟลเดอร์บนสุด)
   ใช้ตัวแปรสีจาก base.css (--site-*)
   ===================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--site-bg); color: var(--site-ink);
  font-family: var(--site-font); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--site-font-display); text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--site-link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--site-accent); outline-offset: 3px; border-radius: 8px; }
.wrap {
  max-width: var(--site-wrap); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.band { padding-block: clamp(64px, 10vw, 128px); background: var(--site-bg); }
.band.alt { background: var(--site-bg2); }
.eyebrow { font-size: 15px; font-weight: 600; color: #e8590c; letter-spacing: 0.02em; }
.intro { text-align: center; max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.intro h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.1; font-weight: 700; }
.intro > p:not(.eyebrow) { font-size: clamp(18px, 2vw, 21px); color: var(--site-muted); }

/* ---------- hero ---------- */
.hero {
  text-align: center; padding-block: clamp(72px, 12vw, 150px) clamp(40px, 6vw, 72px);
  background: radial-gradient(1200px 500px at 50% -10%, #eef4ff 0%, rgba(255, 255, 255, 0) 70%), var(--site-bg);
}
.hero h1 { font-size: clamp(46px, 9vw, 104px); line-height: 1.04; font-weight: 700; margin-top: 12px; letter-spacing: -0.025em; }
.hero .lead { font-size: clamp(19px, 2.4vw, 26px); color: var(--site-muted); max-width: 32em; margin: 22px auto 0; line-height: 1.45; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.pill { display: inline-flex; align-items: center; padding: 12px 24px; border-radius: 980px; font-size: 17px; border: 1px solid transparent; transition: transform 0.3s var(--site-ease), background 0.2s; }
.pill:hover { text-decoration: none; transform: translateY(-1px); }
.pill.primary { background: var(--site-accent); color: #ffffff; }
.pill.primary:hover { background: #0077ed; }
.pill.ghost { color: var(--site-link); border-color: currentColor; }

/* ---------- จอใหญ่ที่ขยายตามการเลื่อน ---------- */
.display-band { padding-bottom: clamp(24px, 4vw, 48px); background: var(--site-bg); overflow: hidden; }
.display {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #ffffff 0%, #f3f6fc 55%, #fbf3ee 100%);
  box-shadow: 0 40px 100px rgba(16, 24, 64, 0.10), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: clamp(18px, 4vw, 48px);
}
.display-glow {
  position: absolute; inset: -30% -10% auto; height: 80%;
  background: radial-gradient(closest-side, rgba(122, 90, 248, 0.14), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.display-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: clamp(12px, 2vw, 22px); }
.display-cell {
  --acc: var(--site-accent);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.8); border-radius: 22px; padding: 22px 16px 18px;
  color: var(--site-ink); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: transform 0.5s var(--site-ease), box-shadow 0.5s var(--site-ease);
}
a.display-cell:hover { text-decoration: none; transform: translateY(-6px); box-shadow: 0 22px 50px rgba(0, 0, 0, 0.08); }
.display-cell.soon { opacity: 0.55; }
.display-art { width: 100%; max-width: 240px; }
.display-art svg, .lesson-art svg { display: block; width: 100%; height: auto; }
.display-name { font-family: var(--site-font-display); font-weight: 600; font-size: 19px; text-align: center; line-height: 1.3; }
@media (max-width: 600px) {
  .display-grid { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
  .display-cell { padding: 12px 6px 10px; border-radius: 14px; gap: 6px; }
  .display-name { font-size: 13px; }
}

/* ---------- ข้อความสว่างทีละคำ (กล่องสูง 220vh + ข้อความ sticky) ---------- */
.statement { height: 220vh; background: var(--site-bg); }
.statement-sticky { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; }
.statement-text {
  font-family: var(--site-font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(30px, 5.4vw, 64px); line-height: 1.2; max-width: 22em; margin: 0 auto; text-align: center;
}
@media (prefers-reduced-motion: reduce) { .statement { height: auto; padding-block: 96px; } .statement-sticky { position: static; height: auto; } }

/* ---------- ตัวเลขเด่น ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: clamp(36px, 6vw, 64px); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--site-bg); border-radius: 22px; padding: 26px 24px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat b {
  font-family: var(--site-font-display); font-size: clamp(34px, 4.4vw, 52px); line-height: 1.05; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  background: var(--site-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.stat span { font-size: 15px; color: var(--site-muted); }

/* ---------- การ์ดบทเรียน ---------- */
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 20px; margin-top: clamp(36px, 6vw, 64px); }
.lesson {
  --acc: var(--site-accent);
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--site-bg2); border-radius: 28px; color: var(--site-ink);
  transition: transform 0.6s var(--site-ease), box-shadow 0.6s var(--site-ease);
}
a.lesson:hover { text-decoration: none; transform: translateY(-8px); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.10); }
.lesson::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--acc); }
.lesson-art { padding: 34px 40px 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 8%, #ffffff) 0%, var(--site-bg2) 100%); }
.lesson-art svg { max-width: 260px; margin: 0 auto; transition: transform 0.8s var(--site-ease); }
a.lesson:hover .lesson-art svg { transform: scale(1.06); }
.lesson-body { padding: 18px 28px 28px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lesson-unit { font-size: 13px; font-weight: 600; color: var(--acc); }
.lesson h3 { font-size: 24px; line-height: 1.25; font-weight: 700; }
.lesson-desc { color: var(--site-muted); font-size: 16px; }
.lesson-stats { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lesson-stats li { font-size: 13px; color: var(--site-muted); background: var(--site-bg); border-radius: 980px; padding: 4px 12px; }
.lesson-stats b { color: var(--site-ink); font-weight: 600; }
.lesson-go { margin-top: auto; padding-top: 12px; color: var(--site-link); font-size: 17px; }
.lesson.soon { opacity: 0.6; }
.lesson.soon .lesson-go { color: var(--site-muted); }
.lessons-fallback { margin: 32px auto 0; max-width: 640px; font-size: 18px; }

/* ---------- ใช้อย่างไร ---------- */
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: clamp(36px, 6vw, 64px); }
@media (max-width: 820px) { .how { grid-template-columns: 1fr; } }
.how article { background: var(--site-bg); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 8px; }
.how b {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--site-grad); color: #fff; font-family: var(--site-font-display); font-size: 18px;
}
.how h3 { font-size: 22px; margin-top: 6px; }
.how p { color: var(--site-muted); font-size: 16px; }

.home-foot { background: var(--site-bg2); color: var(--site-muted); font-size: 13px; padding-block: 28px 48px; border-top: 1px solid var(--site-line); }
.home-foot .wrap { display: flex; flex-direction: column; gap: 6px; }
