/* Home page, design "Mix 1" (2026-11-07). Colours come from the site tokens in app.css, so the page
   follows the light/dark switch; the design is drawn for dark (the default theme).
   Motion: every animation stops for visitors who ask their device for less motion (bottom of file). */

.home { overflow: hidden; }
.home .hl { color: var(--yellow); }
[data-theme=light] .home .hl { color: var(--gold); }

/* --- hero -------------------------------------------------------------------------------------- */
.h-hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 22px; padding: 72px 0 60px; }
.h-badge { font-size: .82rem; font-weight: 600; color: var(--yellow); padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); }
[data-theme=light] .h-badge { color: var(--text); }
.h-title { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: clamp(2.6rem, 7vw, 4.5rem); line-height: 1.15; font-weight: 700; letter-spacing: -.015em; }
/* Rotating words: all stacked in one grid cell (the cell takes the longest word, so nothing jumps),
   each fades/rises in turn. No overflow clipping, so Thai marks above and below are never cut. */
.h-words { display: grid; justify-items: center; line-height: 1.45; margin-top: 4px; }
.h-word { grid-area: 1 / 1; white-space: nowrap; background: var(--accent); color: #fff; padding: 2px .38em 8px;
  border-radius: 18px; opacity: 0; transform: translateY(22px) scale(.97);
  transition: opacity .5s ease, transform .6s cubic-bezier(.3,.7,.3,1); }
.h-word.on { opacity: 1; transform: none; }               /* app.js moves .on to the next word every 2.5 s */
.h-word.out { opacity: 0; transform: translateY(-22px) scale(.97); }
.h-sub { margin: 0; max-width: 560px; color: var(--muted); font-size: 1.1rem; line-height: 1.7; }

.h-search-wrap { position: relative; width: min(660px, 100%); z-index: 5; }
/* results list under the hero search: the header search's own list styles (.gs-results/.gs-item in app.css) */
.h-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); text-align: left; max-height: min(60vh, 460px); }
.h-search { position: relative; width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 6px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgb(0 0 0 / .35); transition: border-color .2s; }
.h-search:focus-within { border-color: var(--accent); }
.h-search .icon { width: 22px; height: 22px; color: var(--muted); }
.h-search input { border: 0; background: transparent; padding: 14px 4px; font-size: 1.1rem; outline: 0; }
.h-search input:focus { outline: 0; }
[data-theme=light] .h-search { box-shadow: 0 20px 50px rgb(30 20 10 / .08); }
.h-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.h-chip { font: inherit; font-size: .9rem; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); transition: border-color .2s; }
.h-chip:hover { border-color: var(--accent); }

.h-bubble { position: absolute; display: grid; place-items: center; font-weight: 700; border-radius: 22px;
  border: 1px solid var(--line); animation: h-bob 5.5s ease-in-out infinite; pointer-events: none; }
.h-bubble.b1 { left: 2%; top: 80px; width: 72px; height: 72px; background: #2a1c1a; color: #ff8f88; }
.h-bubble.b2 { right: 3%; top: 56px; width: 66px; height: 66px; border-radius: 50%; background: #1c2840; color: #93c5fd; font-size: 1.4rem; animation-delay: .8s; }
.h-bubble.b3 { left: 9%; top: 300px; width: 60px; height: 60px; border-radius: 18px; background: #14302b; color: #5eead4; animation-delay: 1.6s; }
.h-bubble.b4 { right: 9%; top: 280px; width: 76px; height: 76px; border-radius: 24px; background: #2b2440; color: #c9b8ff; animation-delay: .4s; }
[data-theme=light] .h-bubble.b1 { background: #fde2e0; color: #c2362f; }
[data-theme=light] .h-bubble.b2 { background: #dbeafe; color: #1d4ed8; }
[data-theme=light] .h-bubble.b3 { background: #d5f5ec; color: #0f766e; }
[data-theme=light] .h-bubble.b4 { background: #ede9fe; color: #6d28d9; }
@keyframes h-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(3deg); } }

/* --- yellow stats strip ------------------------------------------------------------------------ */
.h-stats { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); background: var(--yellow); color: var(--yellow-ink); }
.h-stats div { padding: 17px 12px; text-align: center; border-right: 1px solid rgb(20 19 18 / .18); }
.h-stats div:last-child { border-right: 0; }
.h-stats b { display: block; font-size: 1.9rem; line-height: 1.3; }
.h-stats span { font-size: .88rem; font-weight: 500; color: #3d3833; }

/* --- sections ------------------------------------------------------------------------------------ */
.h-section { padding-top: 72px; }
.h-h2 { margin: 0 0 22px; font-size: clamp(1.6rem, 3.5vw, 2.25rem); }

/* bento: live tiles of real tools */
.h-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 170px; grid-auto-flow: dense; gap: 14px; }
.bt { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 20px;
  border-radius: 24px; border: 1px solid var(--line); color: var(--text); text-decoration: none;
  transition: transform .25s ease, border-color .25s ease; overflow: hidden; }
.bt:hover { transform: translateY(-6px); border-color: var(--accent); }
.bt.w2 { grid-column: span 2; }
.bt.h2 { grid-row: span 2; }
.bt-label { font-size: .82rem; font-weight: 600; }
.bt-note { font-size: .82rem; opacity: .85; }
.bt-big { font-size: 1.3rem; line-height: 1.3; }
.bt-mid { font-size: 1.2rem; }
.bt-huge { font-size: 1.8rem; line-height: 1.25; }
.bt-bar { height: 10px; border-radius: 5px; background: rgb(255 255 255 / .08); overflow: hidden; }
.bt-bar i { display: block; height: 100%; border-radius: 5px; background: currentColor; }
.bt-roll { height: 44px; overflow: hidden; font-size: 2rem; font-weight: 700; line-height: 44px; color: var(--text); }
.bt-roll > span { display: flex; flex-direction: column; }
.bt-roll > span > * { height: 44px; }
.bt-center { align-items: center; justify-content: center; }
.bt-center .bt-label { position: absolute; bottom: 14px; }
.bt-row { flex-direction: row; align-items: center; justify-content: flex-start; gap: 20px; }
.bt-text { display: flex; flex-direction: column; gap: 6px; }
.bt-clock { width: 96px; height: 96px; flex: none; }
.bt-qr { width: 150px; height: 150px; align-self: center; }

.bt-dark { background: var(--surface); }
.bt-dark .bt-bar i { background: var(--accent); }
.bt-paper { background: #f4f1ec; color: #141312; border-color: #f4f1ec; align-items: center; }
.bt-paper .bt-label { align-self: flex-start; }
.bt-blue { background: #1c2840; border-color: #2a3a5a; color: #93c5fd; }
.bt-red { background: #2a1c1a; border-color: #3d2a27; color: #ff8f88; }
.bt-red .on { color: var(--text); }
.bt-green { background: #17301f; border-color: #245035; color: #6fcf97; }
.bt-green .bt-mid { color: var(--text); }
.bt-teal { background: #14302b; border-color: #1f4a42; color: #5eead4; }
.bt-violet { background: #1b1630; border-color: #3d3466; color: #c9b8ff; }
.bt-violet .bt-big { color: var(--text); font-size: 1.15rem; }
.bt-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.bt-accent:hover { border-color: var(--yellow); }
[data-theme=light] .bt-blue { background: #dbeafe; border-color: #c7dcfb; color: #1d4ed8; }
[data-theme=light] .bt-red { background: #fde2e0; border-color: #f8cdca; color: #c2362f; }
[data-theme=light] .bt-green { background: #e6f2ea; border-color: #cfe6d7; color: #1d6f42; }
[data-theme=light] .bt-teal { background: #d5f5ec; border-color: #bcebdd; color: #0f766e; }
[data-theme=light] .bt-violet { background: #ede9fe; border-color: #ddd6fe; color: #6d28d9; }
[data-theme=light] .bt-paper { border-color: var(--line); }

.a-fill { animation: a-fill 3s ease-in-out infinite; }
.a-shrink { animation: a-shrink 4s ease-in-out infinite; }
.a-pix { animation: a-pix 2.4s ease-in-out infinite; }
.a-count { animation: a-count 5s steps(9) infinite; }
.a-swap { animation: a-swap 4s ease-in-out infinite; }
.a-dice { animation: a-roll 3s ease-in-out infinite; }
.a-hand { transform-box: view-box; transform-origin: 37px 37px; animation: a-spin 6s linear infinite; }
@keyframes a-fill { 0% { width: 5%; } 75%, 100% { width: 100%; } }
@keyframes a-shrink { 0%, 30% { width: 100%; } 60%, 100% { width: 5%; } }
@keyframes a-pix { 0%, 100% { opacity: 1; } 50% { opacity: .12; } }
@keyframes a-count { from { transform: translateY(0); } to { transform: translateY(-90%); } }
@keyframes a-swap { 0%, 40% { transform: translateY(0); } 50%, 90% { transform: translateY(-50%); } 100% { transform: translateY(0); } }
@keyframes a-roll { 0% { transform: rotate(0) scale(1); } 20% { transform: rotate(200deg) scale(.88); } 30%, 100% { transform: rotate(360deg) scale(1); } }
@keyframes a-spin { to { transform: rotate(360deg); } }

/* all tools: category tabs + list */
.h-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.h-tabs button { font: inherit; font-size: .92rem; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line); transition: all .2s; }
.h-tabs button:hover { color: var(--text); }
.h-tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.h-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; border-top: 1px solid var(--line); }
.tool-row { display: flex; align-items: center; gap: 16px; padding: 16px 12px; border-bottom: 1px solid var(--line);
  border-radius: 12px; color: var(--text); text-decoration: none; transition: background .2s; }
.tool-row:hover { background: var(--surface); }
.tr-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; }
.tr-ico .icon { width: 22px; height: 22px; }
.g-files .tr-ico { background: #2a1c1a; color: #ff8f88; }
.g-calc .tr-ico { background: #1c2840; color: #93c5fd; }
.g-fun .tr-ico { background: #14302b; color: #5eead4; }
.g-general .tr-ico { background: #2b2440; color: #c9b8ff; }
[data-theme=light] .g-files .tr-ico { background: #fde2e0; color: #c2362f; }
[data-theme=light] .g-calc .tr-ico { background: #dbeafe; color: #1d4ed8; }
[data-theme=light] .g-fun .tr-ico { background: #d5f5ec; color: #0f766e; }
[data-theme=light] .g-general .tr-ico { background: #ede9fe; color: #6d28d9; }
.tr-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tr-text b { font-size: 1rem; }
.tr-text > span { font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-quota { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.tr-arrow { color: var(--accent); font-size: 1.2rem; opacity: 0; transform: translateX(-6px); transition: all .2s; }
.tool-row:hover .tr-arrow { opacity: 1; transform: none; }

/* Prompt Play + sign-up band */
.h-pp { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 28px 32px; border-radius: 28px;
  background: #1b1630; border: 1px solid #3d3466; color: #f4f1ec; text-decoration: none; transition: border-color .2s; }
.h-pp:hover { border-color: #8b5cf6; }
.h-pp-ico { display: grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: 18px; background: #2b2440; color: #c9b8ff; }
.h-pp-ico .icon { width: 30px; height: 30px; }
.h-pp-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; }
.h-pp-text b { font-size: 1.35rem; }
.h-pp-text b span { color: #ff8f88; font-size: 1.05rem; }
.h-pp-text > span { color: #b9b3ab; }
/* Live Stage band (same shape, TubHool red) */
.h-pp-btn { background: #c9b8ff; color: #1b1630; font-weight: 700; padding: 12px 20px; border-radius: 12px; }
.h-cta { margin-top: 80px; padding: 64px 16px; text-align: center; background: var(--accent); color: #fff;
  display: flex; flex-direction: column; gap: 14px; align-items: center; }
.h-cta h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.5rem); }
.h-cta p { margin: 0; opacity: .92; font-size: 1.05rem; }
.h-cta-btn { background: #141312; color: #fff; font-weight: 600; padding: 14px 26px; border-radius: 12px; text-decoration: none; }
.h-cta-link { color: #fff; padding: 14px 14px; text-decoration: underline; }
main:has(.home) { padding-bottom: 0; }

/* --- Live Stage tile (bento) ---------------------------------------------------------------------- */
.bt-live { overflow: hidden; color: #fff; border-color: rgb(255 120 110 / .35); flex-direction: row; align-items: stretch; gap: 18px;
  background: radial-gradient(120% 100% at 0% 0%, #6b1d1a 0%, transparent 60%), radial-gradient(90% 120% at 100% 100%, #3b1f7a 0%, transparent 60%), #160d14; }
.bt-live:hover { border-color: var(--yellow); }
.bl-glow { position: absolute; inset: auto -20% -60% 30%; height: 120%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgb(232 69 60 / .45), transparent); animation: bl-glow 5s ease-in-out infinite alternate; }
@keyframes bl-glow { to { transform: translate(-12%, -8%) scale(1.15); opacity: .7; } }
.bl-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.bl-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 99px;
  font-size: .78rem; font-weight: 700; color: #fff; background: rgb(232 69 60 / .9); box-shadow: 0 0 0 4px rgb(232 69 60 / .18); }
.bl-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: bl-pulse 1.2s ease-in-out infinite; }
@keyframes bl-pulse { 50% { opacity: .25; transform: scale(.7); } }
.bl-title { font-size: 2.3rem; line-height: 1.05; letter-spacing: -.01em;
  background: linear-gradient(90deg, #fff 30%, #ffd166 60%, #ff8f88); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bl-sub { font-size: 1.02rem; color: rgb(255 255 255 / .86); line-height: 1.5; }
.bl-cta { margin-top: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bl-btn { padding: 9px 16px; border-radius: 12px; background: var(--yellow); color: #1a1408; font-weight: 700; font-size: .92rem;
  box-shadow: 0 8px 22px rgb(255 209 102 / .25); transition: transform .2s; }
.bt-live:hover .bl-btn { transform: translateX(3px); }
.bl-note { font-size: .78rem; color: rgb(255 255 255 / .6); }
.bl-phone { position: relative; z-index: 1; flex: none; align-self: center; height: 94%; aspect-ratio: 9 / 16; border-radius: 20px; padding: 5px;
  background: #050506; box-shadow: 0 0 0 1px rgb(255 255 255 / .16), 0 18px 40px rgb(0 0 0 / .55); transform: rotate(3deg); }
.bl-phone video { width: 100%; height: 100%; display: block; border-radius: 15px; object-fit: cover; background: #000; }

/* full-width banner: the PC window with the stage on a phone beside it */
.bt-live.bl-b { grid-column: 1 / -1; grid-row: span 2; padding: 30px 34px; gap: 30px; }
.bl-b .bl-title { font-size: 3rem; }
.bl-b .bl-sub { max-width: 30em; }
.bl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bl-chips span { padding: 5px 12px; border-radius: 99px; font-size: .84rem; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); }
.bl-scene { position: relative; z-index: 1; flex: 0 0 52%; display: flex; align-items: center; }
.bl-win { width: 86%; border-radius: 10px; overflow: hidden; background: #0f0e0d; border: 1px solid #3a3530; box-shadow: 0 20px 50px rgb(0 0 0 / .55);
  transform: perspective(900px) rotateY(-8deg); }
.bl-win-bar { display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; background: #1c1a18; font-size: .66rem; color: #bbb; }
.bl-win-bar i { width: 7px; height: 7px; border-radius: 50%; background: #555; }
.bl-win-bar i:first-child { background: #e8453c; } .bl-win-bar i:nth-child(2) { background: #ffd166; } .bl-win-bar i:nth-child(3) { background: #6fcf97; margin-right: 4px; }
.bl-win video { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
.bl-b .bl-phone { position: absolute; right: 0; bottom: -6px; height: 92%; transform: rotate(4deg); }

@media (max-width: 900px) {
  .bt-live.bl-b { flex-direction: column; grid-row: span 4; padding: 22px; }
  .bl-b .bl-title { font-size: 2.3rem; }
  .bl-scene { flex: 1; min-height: 0; }
}
@media (max-width: 560px) {
  .bl-title { font-size: 1.9rem; }
  .bt-live.bl-b { grid-row: span 4; }
  .bl-b .bl-title { font-size: 2rem; }
  .bl-b .bl-scene { min-height: 230px; }
}

/* --- small screens ----------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .h-bubble { display: none; }
  .h-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-list { grid-template-columns: 1fr; }
  .tr-quota { display: none; }
}
@media (max-width: 560px) {
  .h-hero { padding: 44px 0 40px; }
  .h-word { border-radius: 14px; }
  .h-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-stats div:nth-child(2) { border-right: 0; }
  .h-stats div:nth-child(-n+2) { border-bottom: 1px solid rgb(20 19 18 / .18); }
  .h-bento { grid-auto-rows: 150px; gap: 10px; }
  .bt { padding: 16px; border-radius: 20px; }
  .bt-huge { font-size: 1.35rem; }
  .bt-qr { width: 110px; height: 110px; }
  .bt-row .bt-clock { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .home *, .home *::before { animation: none !important; transition: none !important; }
}
