/*
  Hing Hoi · shared brand layer (hing-hoi.com and play.hing-hoi.com)
  Firefly canvas, firefly jar and toast, button glow, page transitions,
  and the Thai display face. Loaded after each site's own stylesheet.
*/

/* ---------- firefly layer ---------- */
.hh-fireflies{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:60}
.hh-toast{position:fixed;left:50%;bottom:calc(96px + env(safe-area-inset-bottom,0px));transform:translate(-50%,20px);z-index:120;opacity:0;pointer-events:none;transition:opacity .25s ease,transform .25s ease;max-width:calc(100% - 32px)}
.hh-toast.is-on{opacity:1;transform:translate(-50%,0);pointer-events:auto}
.hh-toast>*{display:block;padding:10px 18px;border-radius:999px;background:#0d1730;color:#fffaf0;font-size:14px;font-weight:700;line-height:1.6;text-align:center;box-shadow:0 8px 28px rgba(13,23,48,.35),0 0 0 1px rgba(255,213,74,.45);text-decoration:none}
.hh-toast a{color:#ffd54a;text-decoration:underline;text-underline-offset:3px}
.hh-jar{position:fixed;left:16px;bottom:calc(92px + env(safe-area-inset-bottom,0px));z-index:110;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:4px 12px 4px 8px;border-radius:999px;background:#0d1730;color:#fffaf0;font-size:13px;font-weight:700;text-decoration:none;box-shadow:0 6px 20px rgba(13,23,48,.3)}
.hh-jar svg{width:22px;height:28px}
.hh-jar.is-full{box-shadow:0 0 0 2px #ffd54a,0 0 22px rgba(255,213,74,.6)}
.hh-jar:focus-visible{outline:3px solid #ffd54a;outline-offset:3px}
@media (min-width:801px){.hh-toast{bottom:28px}.hh-jar{bottom:24px}}

/* ---------- micro-interactions: buttons glow like a firefly ---------- */
@media (prefers-reduced-motion:no-preference){
  .btn,.htu-btn-y,.htu-cta,.htu-go a,.htu-xbtn,.htu-filterbtn,.btn-primary,.share-actions button{transition:box-shadow .25s ease,transform .15s ease,background-color .2s ease}
  .btn:hover,.htu-btn-y:hover,.htu-cta:hover,.htu-go a:hover,.btn-primary:hover{box-shadow:0 0 0 4px rgba(255,213,74,.22),0 0 26px rgba(255,213,74,.45)}
  .btn:active,.htu-btn-y:active,.htu-cta:active,.htu-go a:active,.htu-xbtn:active,.htu-filterbtn:active,.btn-primary:active{transform:scale(.97)}
  /* page changes fade like dusk (same-site navigations, where supported) */
  @view-transition{navigation:auto}
  ::view-transition-old(root){animation:hh-dusk-out .28s ease both}
  ::view-transition-new(root){animation:hh-dusk-in .36s ease both}
  @keyframes hh-dusk-out{to{opacity:0;filter:brightness(.7)}}
  @keyframes hh-dusk-in{from{opacity:0;filter:brightness(.7)}}
}
@media (prefers-reduced-motion:reduce){.hh-toast{transition:none}}

/* ---------- Thai display face, used with restraint: page and section titles ----------
   fireflies.js loads the face after the page has finished loading (so it never
   competes with the first paint), then adds .hh-display to <html>. */
html.hh-display[lang=th] h1,html.hh-display[lang=th] h2{font-family:"HH Display","Noto Serif Thai","Gilda Display",serif;font-weight:400;letter-spacing:0}
html.hh-display[lang=th] h1{line-height:1.42}
html.hh-display[lang=th] h2{line-height:1.5}
