/* ---------- แถบบน ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); transition: background-color .3s, box-shadow .3s, backdrop-filter .3s; }
.nav.is-scrolled, .nav.is-open { background: rgba(255, 247, 240, .86); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 1px 0 var(--line); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 24px; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo__tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #f58a3f, var(--orange) 55%, var(--orange-2)); color: #fff; box-shadow: 0 6px 14px -6px rgba(239, 109, 32, .8); }
.logo__tile .mark { width: 27px; height: auto; }
.logo__word { font-family: var(--font-hand); font-weight: 700; font-size: 32px; line-height: 1; color: var(--orange); letter-spacing: .01em; transform: translateY(-1px); }
.logo--light .logo__word { color: var(--on-dark); }

.nav__links { display: flex; gap: 4px; margin-inline: auto; }
.nav__links > a { padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--ink-2); text-decoration: none; transition: background-color .2s, color .2s; }
.nav__links > a:hover { background: rgba(239, 109, 32, .1); color: var(--ink); }
.nav__mobile-cta { display: none; }
.nav__actions { display: flex; align-items: center; gap: 14px; }
.langs { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(42, 28, 18, .07); }
.langs__opt { min-width: 38px; padding: 6px 10px; border-radius: 999px; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); text-decoration: none; transition: background-color .2s, color .2s; }
.langs__opt:hover { color: var(--ink); }
.langs__opt[aria-current="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.nav__login { font-size: 15px; font-weight: 600; text-decoration: none; color: var(--ink); }
.nav__login:hover { color: var(--orange-2); }
.nav__burger { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(42, 28, 18, .06); cursor: pointer; padding: 0; position: relative; }
.nav__burger span { position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .2s; }
.nav__burger span:nth-child(1) { top: 15px; }
.nav__burger span:nth-child(2) { top: 21px; }
.nav__burger span:nth-child(3) { top: 27px; }
.nav.is-open .nav__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav__burger span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 980px) {
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto; height: calc(100dvh - var(--nav-h));
    flex-direction: column; gap: 2px; padding: 20px 20px 32px; margin: 0;
    background: var(--cream); overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .3s var(--ease), visibility .25s;
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
  .nav__links > a { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--ink); padding: 12px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav__mobile-cta { display: grid; gap: 12px; margin-top: 28px; }
  .nav__login { display: none; }
  .nav__burger { display: block; }
  .nav__actions { margin-left: auto; gap: 8px; }
}
@media (max-width: 560px) {
  .nav__start { display: none; }
}

/* ---------- Hero ---------- */
/* โผล่ด้วย CSS ล้วน (ไม่รอ JS · ไม่ซ่อนด้วย opacity = ไม่ถ่วง LCP) */
.rise { animation: rise 1s var(--ease) both; animation-delay: var(--delay, 0s); }
@keyframes rise { from { transform: translateY(22px); } }
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: calc(var(--nav-h) + clamp(32px, 6vw, 80px)) 0 clamp(64px, 8vw, 110px);
  background:
    radial-gradient(60% 55% at 85% 20%, rgba(239, 109, 32, .18), transparent 70%),
    radial-gradient(45% 45% at 70% 95%, rgba(124, 58, 237, .14), transparent 70%),
    radial-gradient(40% 40% at 5% 10%, rgba(242, 180, 90, .2), transparent 70%),
    var(--cream);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.hero__staff { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__staff svg { position: absolute; left: 0; right: 0; bottom: 6%; width: 100%; height: 300px; }
.staff-line { fill: none; stroke: rgba(42, 28, 18, .11); stroke-width: 1.4; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 2.6s var(--ease) forwards; animation-delay: calc(var(--i) * .12s + .2s); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.float-note { position: absolute; left: var(--x); top: var(--y); width: 30px; height: 30px; color: var(--orange); opacity: .28; animation: bob 7s ease-in-out infinite; animation-delay: var(--d); }
.float-note:nth-child(odd) { color: var(--violet); width: 24px; height: 24px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-18px) rotate(6deg); } }

.hero__inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 999px; background: rgba(255, 255, 255, .7); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(239, 109, 32, .2); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(239, 109, 32, 0); } }

.hero__title {
  margin-top: 22px;
  font-family: var(--font-display); font-weight: 750; font-variation-settings: "opsz" 144;
  font-size: clamp(44px, 6.4vw, 86px); line-height: 1; letter-spacing: -.026em; word-spacing: .08em;
}
:lang(th) .hero__title { font-size: clamp(40px, 5.8vw, 76px); line-height: 1.2; letter-spacing: -.005em; word-spacing: 0; }
.hero__title .line { display: block; }
.line--accent { font-size: .5em; font-weight: 600; margin-top: .3em; color: var(--ink-2); letter-spacing: -.01em; word-spacing: .04em; text-wrap: balance; }
:lang(th) .line--accent { font-size: .62em; }
.line--accent em {
  font-family: var(--font-hand); font-style: normal; font-weight: 700; font-size: 1.55em; line-height: .8;
  color: var(--orange); position: relative; display: inline-block; padding-inline: .04em;
}
.line--accent em::after {
  content: ""; position: absolute; left: 2%; right: 4%; bottom: -.04em; height: .22em;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'><path d='M2 14 C 50 4, 120 4, 198 10' fill='none' stroke='%23f2b45a' stroke-width='5' stroke-linecap='round'/></svg>") center / 100% 100% no-repeat;
}
.hero__lead { margin-top: 24px; max-width: 34em; font-size: clamp(17px, 1.45vw, 20px); color: var(--ink-2); text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; font-size: 14px; color: var(--ink-3); }
.hero__trust li { display: inline-flex; align-items: center; gap: 7px; }
.hero__trust .icon { color: var(--green); stroke-width: 2.6; }

.hero__stage { position: relative; height: clamp(520px, 52vw, 660px); }
.hero__stage .phone { position: absolute; width: clamp(200px, 21vw, 280px); }
.phone--teacher { left: 2%; top: 2%; rotate: -6deg; z-index: 1; animation: drift-a 9s ease-in-out infinite; }
.hero__stage .phone--family { right: 0; top: 14%; rotate: 5deg; z-index: 2; animation: drift-b 10s ease-in-out infinite; }
@keyframes drift-a { 50% { transform: translateY(-12px); } }
@keyframes drift-b { 50% { transform: translateY(10px); } }
.hero__melody { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.hero__melody path { fill: none; stroke: url(#melody-grad); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 12; opacity: .9; }
.melody-note circle { fill: #fff; stroke: var(--orange); stroke-width: 4; filter: drop-shadow(0 4px 6px rgba(239, 109, 32, .45)); }

.chip {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 16px; background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600; white-space: nowrap;
  animation: bob-soft 6s ease-in-out infinite;
}
.chip__ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--orange-soft); color: var(--orange-2); }
.chip__ic--green { background: #dcf5e8; color: var(--green); }
.chip__ic--violet { background: var(--violet-soft); color: var(--violet); }
.chip--checkin { left: -4%; top: 52%; animation-delay: -1s; }
.chip--mission { right: 30%; top: -1%; animation-delay: -3s; }
.chip--renew { right: -2%; bottom: 3%; animation-delay: -2s; }
@keyframes bob-soft { 50% { transform: translateY(-8px); } }

@media (max-width: 980px) {
  .float-note { display: none; }   /* จอแคบ: โน้ตลอยทับตัวหนังสือ/ปุ่ม → ซ่อน (เหลือเส้นบรรทัด) */
  .hero__inner { grid-template-columns: 1fr; }
  .hero__copy { text-align: center; }
  .hero__lead { margin-inline: auto; }
  .hero__cta, .hero__trust { justify-content: center; }
  .hero__trust { gap: 8px; }
  .hero__trust li { padding: 5px 12px 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, .62); box-shadow: inset 0 0 0 1px var(--line); font-size: 13.5px; color: var(--ink-2); }
  .hero__stage { height: auto; aspect-ratio: 1 / 1.02; max-width: 560px; width: 100%; margin: 12px auto 0; }
  .hero__stage .phone { width: 47%; }
  .phone--teacher { left: 2%; }
  .chip { font-size: 12.5px; padding: 8px 12px 8px 8px; }
  .chip__ic { width: 26px; height: 26px; }
  .chip--checkin { left: 0; top: 60%; }
  .chip--mission { right: 26%; top: 0; }
  .chip--renew { right: 0; bottom: 2%; }
}
@media (max-width: 600px) {
  .line--accent { font-size: .62em; }
}
@media (max-width: 480px) {
  .eyebrow { gap: 8px; padding: 6px 12px 6px 9px; font-size: 12.5px; }
  .hero__cta .btn { flex: 1 1 100%; }
  .chip--mission { right: auto; left: 30%; top: -2%; }
}
