/* LangTai brand v2 (2026-11-18): L-shaped bubble mark + LangTai / แหลงใต้ (lockup B).
 * Loaded after site.css. Fonts are 1 KB subsets (only the letters of the name),
 * Poppins 600 (OFL) and Prompt 600 (OFL), self-hosted for the font-src 'self' CSP.
 * Translator page only (.lt-hint): ~4 s after load the bubble hops, the yellow fold flaps, a "?" pops
 * into the bubble and "แหลงใต้" rolls to "รู้จัก LangTai ›" — and stays (owner: pattern B, "ค้างยาว").
 * It waits while the text box has focus. Every other page: plain logo that links home. */
@font-face { font-family: 'LangTai Brand EN'; font-weight: 600; font-display: block;
  src: url('fonts/langtai-brand-en-600-v2.woff2') format('woff2'); }
@font-face { font-family: 'LangTai Brand TH'; font-weight: 600; font-display: block;
  src: url('fonts/langtai-brand-th-600-v2.woff2') format('woff2'); }

.brand.lt-b { gap: 10px; padding: 4px 10px 4px 4px; margin-left: -4px; border-radius: 14px;
  transition: background-color .25s ease; -webkit-tap-highlight-color: transparent; }
.lt-b .lt-mark { width: 36px; height: 37px; flex: none; overflow: visible; }
.lt-b .lt-body { transform-box: fill-box; transform-origin: 50% 90%;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.lt-b .lt-name { display: flex; flex-direction: column; line-height: 1; }
.lt-b .lt-en { font: 600 22px/1 'LangTai Brand EN', 'Poppins', system-ui, sans-serif;
  letter-spacing: -.01em; color: #2A2A35; }
.lt-b .lt-th { font: 600 12.5px/1.25 'LangTai Brand TH', 'Prompt', 'LangTai Thai', sans-serif;
  color: #6B6F86; margin-top: 2px; height: 1.25em; overflow: hidden; }
.lt-b .lt-roll { display: flex; flex-direction: column; }
.lt-b .lt-roll > span { display: block; height: 1.25em; white-space: nowrap; }
/* "รู้จัก LangTai ›": no frame, just a soft light band sweeping across every ~3.6 s (owner: "วิ้งๆ", no blinking). */
.lt-b .lt-about { font-family: 'LangTai Brand TH', 'LangTai Brand EN', 'Prompt', 'LangTai Thai', sans-serif;
  color: #8E6CE8; background: linear-gradient(100deg, #8E6CE8 0 38%, #F0E8FF 48%, #FF9CCB 52%, #8E6CE8 62% 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand.lt-hint { position: relative; }

@media (hover: hover) { .brand.lt-b:hover { background: rgba(142, 108, 232, .08); } }
.brand.lt-b:hover .lt-body, .brand.lt-b:focus-visible .lt-body, .brand.lt-b:active .lt-body {
  transform: rotate(-6deg) scale(1.07); }

/* ---- the hint (translator page) ---- */
.lt-hint .lt-q { opacity: 0; transform-box: fill-box; transform-origin: 50% 60%;
  animation: lt-q-in .75s cubic-bezier(.34, 1.56, .64, 1) 4s both; }
.lt-hint .lt-body { animation: lt-hop .7s cubic-bezier(.3, .7, .4, 1) 3.85s; }
.lt-hint .m2-yellow { transform-box: fill-box; transform-origin: 0% 0%; animation: lt-flap .7s ease-in-out 4.05s; }
.lt-hint .lt-roll { animation: lt-roll .6s cubic-bezier(.34, 1.4, .64, 1) 4.25s both; }
.brand.lt-hint:hover .lt-q, .brand.lt-hint:focus-visible .lt-q {
  animation: lt-q-in .75s cubic-bezier(.34, 1.56, .64, 1) 4s both, lt-wiggle .6s ease-in-out; }
.lt-hint .lt-about { animation: lt-shine 3.6s ease-in-out 5s infinite; }
.tr-page:has(textarea:focus, input:focus) .lt-hint * { animation-play-state: paused; }

/* First visit only (brand-hint.js adds .show once, remembers it in localStorage). */
.lt-tip { position: absolute; left: 0; top: calc(100% + 10px); z-index: 30; white-space: nowrap; pointer-events: auto;
  font: 500 13.5px/1.3 'LangTai Thai', system-ui, sans-serif; color: #FFFFFF; background: #2A2A35;
  padding: 9px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(29, 29, 31, .18);
  opacity: 0; transform: translateY(6px); visibility: hidden;
  transition: opacity .3s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1), visibility 0s linear .3s; }
.lt-tip::before { content: ""; position: absolute; left: 16px; top: -5px; width: 11px; height: 11px;
  background: #2A2A35; transform: rotate(45deg); border-radius: 2px; }
.lt-tip.show { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }

@keyframes lt-shine { 0%, 35% { background-position: 100% 0; } 75%, 100% { background-position: 0 0; } }

@keyframes lt-q-in { 0% { opacity: 0; transform: scale(.2) rotate(-25deg); } 100% { opacity: 1; transform: none; } }
@keyframes lt-hop { 0%, 100% { transform: none; } 30% { transform: translateY(-3px) scaleY(1.08) scaleX(.95); }
  55% { transform: translateY(0) scaleY(.9) scaleX(1.06); } 75% { transform: scaleY(1.03); } }
@keyframes lt-flap { 0%, 100% { transform: none; } 40% { transform: rotate(-14deg); } 70% { transform: rotate(6deg); } }
@keyframes lt-roll { to { transform: translateY(-1.25em); } }
@keyframes lt-wiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } }

@media (prefers-reduced-motion: reduce) {
  .lt-b .lt-body { transition: none; }
  .brand.lt-b .lt-body { transform: none !important; }
  .lt-hint .lt-body, .lt-hint .m2-yellow, .lt-hint .lt-about { animation: none; }
    .lt-tip { transition: opacity .2s linear, visibility 0s linear .2s; transform: none; }
  .lt-hint .lt-q, .brand.lt-hint:hover .lt-q { animation: lt-q-in .01s linear 4s both; }
  .lt-hint .lt-roll { animation: lt-roll .01s linear 4s both; }
}

/* Phones: keep the header on one line next to the Google sign-in button. */
@media (max-width: 480px) {
  .brand.lt-b { gap: 8px; padding: 3px 6px 3px 3px; }
  .lt-b .lt-mark { width: 32px; height: 33px; }
  .lt-b .lt-en { font-size: 19px; }
  .lt-b .lt-th { font-size: 11px; margin-top: 1px; }
}
@media (max-width: 380px) {
  .brand.lt-b { gap: 7px; padding: 2px 4px 2px 2px; margin-left: -2px; }
  .lt-b .lt-mark { width: 29px; height: 30px; }
  .lt-b .lt-en { font-size: 18px; }
}

/* ---------- site footer (/about) ----------
 * Links keep site.css's outlined pills. Phone: centred, credit line below. */
.site-foot .wrap { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) {
  .site-foot .wrap { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .foot-links { justify-content: center; }
  .foot-note { order: 2; margin: 0; font-size: 12.5px; line-height: 1.5; }
}

/* Google sign-in: app.js can call renderGsiButtons() twice on load (script onload + session check), and Google
 * then draws a second button that spills over the page. Show only the first one. (2026-11-18) */
#gsiHeaderBtn > * + *, #gsiPromptBtn > * + * { display: none !important; }
