/* HANGFOOK overseas homepage — rebuilt 1:1 from Figma "HANGFOOK 官网 · 首页与视差".
   Every layer is positioned in artboard pixels (--x/--y/--w/--h) and the whole artboard
   is scaled by --s so the design fills the full window width at its original aspect ratio. */

:root {
  --paper: #F7F5EF;
  --ink: #25251F;
  --blue: #31CCFF;
  --yellow: #FFD400;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
.stage picture { display: block; width: 100%; height: 100%; }
.stage img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Artboards ---------- */
.stage-wrap { position: relative; width: 100%; overflow: hidden; background: var(--paper); }
#deskWrap { height: calc(960px * var(--s, 1)); }
#mobWrap { height: calc(860px * var(--s, 1)); }
html.is-desk #mobWrap, html.is-mob #deskWrap { display: none; }
html:not(.is-desk):not(.is-mob) #mobWrap { display: none; }

.stage {
  position: absolute; left: 0; top: 0;
  transform: scale(var(--s, 1)); transform-origin: 0 0;
  overflow: hidden; background: var(--paper);
}
#desk { width: 1440px; height: 960px; }
#mob { width: 390px; height: 860px; }

/* ---------- Layers ---------- */
.L {
  position: absolute;
  left: calc(var(--x) * 1px); top: calc(var(--y) * 1px);
  width: calc(var(--w) * 1px); height: calc(var(--h) * 1px);
}
.px { will-change: transform; }
.pop, .hv, .ib { position: absolute; inset: 0; }
.b-body { position: absolute; inset: 0; transform-origin: var(--ox) var(--oy); }
.nav-line .pop { background: var(--ink); transform-origin: 0 50%; }

/* Hit areas from the design */
.hot { display: block; cursor: pointer; border-radius: 6px; outline: none; }
.hot:focus-visible { outline: 3px dashed var(--ink); outline-offset: 6px; }
.sticker .hv, .word .hv, [data-hover="giraffe"] { cursor: pointer; }

/* Header rounded social icons (IG, X/Twitter, TikTok) */
.nav-social { z-index: 25; }
.nav-social .pop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
#mob .nav-social .pop { gap: 8px; }
.soc-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 2.2px solid var(--ink);
  background: #FFFDF8;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 3.5px 0 var(--ink);
  transform-origin: 50% 60%;
  will-change: transform;
  transition: box-shadow .16s ease, background .18s ease;
}
#mob .soc-btn {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  border-width: 1.6px;
  box-shadow: 0 2px 0 var(--ink);
}
.soc-btn svg { width: 22px; height: 22px; display: block; transition: transform .35s var(--spring); }
#mob .soc-btn svg { width: 15px; height: 15px; }
.soc-btn:hover { box-shadow: 0 6px 0 var(--ink); }
.soc-btn:hover svg { transform: scale(1.12); }
.soc-btn:nth-child(1):hover { background: var(--yellow); }
.soc-btn:nth-child(2):hover { background: var(--blue); }
.soc-btn:nth-child(3):hover { background: #B8F2D6; }
.soc-btn:active { box-shadow: 0 1px 0 var(--ink); }
.soc-btn:active svg { transform: scale(.86); }
.soc-btn:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }

/* ---------- Entrance (Q-bounce pop-in, starts once images are ready; safe when JS disabled) ---------- */
html.has-js .pop {
  animation-duration: 1s;
  animation-delay: var(--d, 0ms);
  animation-fill-mode: both;
  animation-timing-function: linear;
}
html.has-js:not(.is-ready) .pop { animation-play-state: paused; }

.a-fade { animation-name: aFade; animation-duration: .9s; animation-timing-function: ease-out; }
@keyframes aFade { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }

.a-rainbow { animation-name: aRainbow; animation-duration: 1.25s; }
@keyframes aRainbow {
  0%   { clip-path: circle(0% at 0% 100%); transform: scale(.86) rotate(-6deg); }
  55%  { clip-path: circle(120% at 0% 100%); transform: scale(1.04) rotate(1.5deg); }
  75%  { transform: scale(.985) rotate(-.6deg); }
  100% { clip-path: circle(160% at 0% 100%); transform: none; }
}

.a-line { animation-name: aLine; animation-duration: .9s; animation-timing-function: cubic-bezier(.7, 0, .2, 1); }
@keyframes aLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.a-drop { animation-name: aDrop; animation-duration: .8s; }
@keyframes aDrop {
  0%   { opacity: 0; transform: translateY(-26px) scale(.8); }
  55%  { opacity: 1; transform: translateY(4px) scale(1.06, .94); }
  78%  { transform: translateY(-2px) scale(.98, 1.02); }
  100% { transform: none; }
}

.a-giraffe { animation-name: aGiraffe; animation-duration: 1.15s; transform-origin: 60% 100%; }
@keyframes aGiraffe {
  0%   { opacity: 0; transform: translateY(140px) scale(.92, 1.06); }
  50%  { opacity: 1; transform: translateY(-16px) scale(1.02, .98); }
  70%  { transform: translateY(6px) scale(.99, 1.01); }
  86%  { transform: translateY(-2px); }
  100% { transform: none; }
}

.a-word { animation-name: aWord; animation-duration: 1s; transform-origin: 50% 100%; }
@keyframes aWord {
  0%   { opacity: 0; transform: translateY(46px) scale(1.18, .35); }
  45%  { opacity: 1; transform: translateY(-10px) scale(.94, 1.12); }
  65%  { transform: translateY(3px) scale(1.04, .96); }
  82%  { transform: translateY(-1px) scale(.99, 1.01); }
  100% { transform: none; }
}

.a-rise { animation-name: aRise; animation-duration: 1.05s; transform-origin: 50% 100%; }
@keyframes aRise {
  0%   { opacity: 0; transform: translateY(120px) scale(.94); }
  50%  { opacity: 1; transform: translateY(-14px) scale(1.02, .98); }
  70%  { transform: translateY(5px) scale(.995, 1.01); }
  86%  { transform: translateY(-2px); }
  100% { transform: none; }
}

.a-peek { animation-name: aPeek; animation-duration: .95s; transform-origin: 50% 100%; }
@keyframes aPeek {
  0%   { transform: translateY(70%) scale(1, .7); }
  45%  { transform: translateY(-12%) scale(.94, 1.1); }
  65%  { transform: translateY(4%) scale(1.04, .95); }
  82%  { transform: translateY(-2%); }
  100% { transform: none; }
}

.a-pop { animation-name: aPop; animation-duration: .9s; }
@keyframes aPop {
  0%   { opacity: 0; transform: scale(.15) rotate(-28deg); }
  50%  { opacity: 1; transform: scale(1.18) rotate(7deg); }
  68%  { transform: scale(.9) rotate(-4deg); }
  84%  { transform: scale(1.05) rotate(1.5deg); }
  100% { transform: none; }
}

/* ---------- Idle motion ---------- */
.idle.sway { animation: sway var(--sd, 3.4s) ease-in-out var(--sdl, 0s) infinite alternate; }
@keyframes sway {
  from { transform: rotate(calc(var(--rot, 4deg) * -.6)) translateY(0); }
  to   { transform: rotate(calc(var(--rot, 4deg) * .6)) translateY(-3px); }
}
.idle.giraffe-sway { transform-origin: 62% 100%; animation: gSway 5.6s ease-in-out infinite alternate; }
@keyframes gSway { from { transform: rotate(-.55deg); } to { transform: rotate(.55deg); } }

/* Download arrow: periodic attention nudge, faster bounce on hover */
.arrow-bob { position: absolute; inset: 0; transform-origin: 50% 80%; animation: nudge 2.6s infinite 2.2s; }
@keyframes nudge {
  0%, 68%, 100% { transform: none; }
  76% { transform: translateY(12px) scale(1.06, .9); }
  84% { transform: translateY(-5px) scale(.96, 1.05); }
  92% { transform: translateY(2px); }
}
.banner.is-hover .arrow-bob { animation: bob .72s infinite; }
@keyframes bob {
  0%, 100% { transform: none; }
  35% { transform: translateY(14px) scale(1.08, .88); }
  60% { transform: translateY(-5px) scale(.95, 1.06); }
  80% { transform: translateY(2px); }
}

/* ---------- Download modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background: rgba(37, 37, 31, .45);
  animation: bdIn .25s ease-out both;
}
.modal-backdrop[hidden] { display: none; }
@keyframes bdIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: min(520px, 100%); max-height: 90vh; overflow-y: auto;
  padding: 24px 24px 18px;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  font-family: "Arial Rounded MT Bold", "Arial", "PingFang SC", "Microsoft YaHei", sans-serif;
  animation: mIn .7s both;
}
@keyframes mIn {
  0%   { transform: translateY(40px) scale(.6); opacity: 0; }
  50%  { transform: translateY(-6px) scale(1.06, .96); opacity: 1; }
  70%  { transform: scale(.97, 1.03); }
  86%  { transform: scale(1.01, .99); }
  100% { transform: none; }
}
.modal-art {
  display: block; width: 230px; height: auto; margin: -4px auto 10px; padding: 8px 14px 4px;
  background: var(--blue); border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: 0 4px 0 var(--ink); transform: rotate(-2deg);
}
.modal h2 { margin: 0 0 10px; font-size: 24px; text-align: center; }
.modal p { margin: 8px 0; font-size: 15px; line-height: 1.55; text-align: center; }
.modal-x {
  position: absolute; right: 14px; top: 12px; width: 36px; height: 36px;
  border: 3px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: transform .45s var(--spring);
}
.modal-x:hover { transform: rotate(90deg) scale(1.1); }
.modal-x:active { transform: scale(.85); }
.sha { margin: 10px 0; padding: 8px 10px; border: 2px dashed var(--ink); border-radius: 12px; background: #fff; font: 12px/1.4 ui-monospace, Consolas, monospace; word-break: break-all; }
.modal .btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 54px; margin-top: 14px;
  border: 3px solid var(--ink); border-radius: 18px;
  background: var(--blue); color: var(--ink);
  font-family: inherit; font-weight: 800; font-size: 18px; line-height: 1; text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .5s var(--spring), box-shadow .2s ease;
}
.modal .btn:hover { transform: translateY(-3px) scale(1.04, .98); box-shadow: 0 8px 0 var(--ink); }
.modal .btn:active { transform: translateY(4px) scale(.96, 1.04); box-shadow: 0 1px 0 var(--ink); transition-duration: .12s; }
.modal .btn.soft { background: var(--yellow); }
.dl-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; text-align: left; }
.dl-card {
  padding: 12px 14px; background: #fff;
  border: 2.5px solid var(--ink); border-radius: 16px;
  box-shadow: 0 3px 0 var(--ink);
}
.dl-card-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px;
  margin-bottom: 4px;
}
.dl-card-head strong { font-size: 16px; }
.dl-card-ver { font-size: 12px; font-weight: 700; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); }
.dl-card-meta { margin: 0 0 8px !important; font-size: 13px !important; opacity: .8; text-align: left !important; }
.dl-card .btn { height: 44px; margin-top: 6px; font-size: 15px; border-radius: 14px; }
.dl-sha { margin-top: 8px; font-size: 12px; }
.dl-sha summary { cursor: pointer; font-weight: 700; opacity: .78; user-select: none; }
.dl-sha .sha { margin: 6px 0 0; font-size: 11px; }
.dl-soon-pill {
  display: inline-block; margin: 4px auto 8px; padding: 5px 14px;
  border: 2.5px solid var(--ink); border-radius: 999px;
  background: var(--yellow); color: var(--ink);
  font-size: 13px; font-weight: 800; box-shadow: 0 3px 0 var(--ink);
}
.modal-legal { margin-top: 14px !important; font-size: 12px !important; opacity: .75; }
.modal-legal a { color: inherit; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .pop, .idle, .arrow-bob, .modal, .modal-backdrop { animation: none !important; }
}

/* ---------- Ultra-minimalist hairline footer & collapsed SEO/GEO drawers ---------- */
.mini-foot {
  background: var(--paper);
  color: rgba(37, 37, 31, .52);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Hiragino Kaku Gothic ProN", "Apple SD Gothic Neo", "Noto Sans Arabic", "Noto Sans Thai", sans-serif;
  font-size: 12px;
  line-height: 1.4;
  padding: 0 24px 18px;
}
.mini-foot-in {
  max-width: 1349px;
  margin: 0 auto;
  padding-top: 12px;
  border-top: 1px solid rgba(37, 37, 31, .14);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.mini-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 11px;
}
.mini-foot a {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}
.mini-foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.mini-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.mini-drop { position: relative; }
.mini-drop > summary {
  list-style: none;
  cursor: pointer;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(37, 37, 31, .2);
  color: rgba(37, 37, 31, .72);
  font-weight: 600;
  font-size: 12px;
  user-select: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.mini-drop > summary::-webkit-details-marker { display: none; }
.mini-drop > summary:hover, .mini-drop[open] > summary {
  background: rgba(37, 37, 31, .06);
  border-color: rgba(37, 37, 31, .4);
  color: var(--ink);
}
.mini-panel {
  position: fixed;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  max-height: min(64vh, 520px);
  overflow-y: auto;
  padding: 16px 18px;
  background: #FFFDF8;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 13px;
  line-height: 1.6;
}
.mini-panel.wide { width: min(560px, calc(100vw - 32px)); }
.mini-panel h2 { margin: 0 0 8px; font-size: 15px; }
.mini-panel h3 { margin: 12px 0 6px; font-size: 13px; }
.mini-panel p { margin: 0 0 8px; color: rgba(37, 37, 31, .78); }
.mini-panel ul { margin: 0 0 10px; padding-inline-start: 18px; color: rgba(37, 37, 31, .78); }
.mini-panel li + li { margin-top: 4px; }
.mini-lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.mini-lang-grid a {
  display: block;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
}
.mini-lang-grid a:hover, .mini-lang-grid a[aria-current="page"] {
  background: #FFF5C2;
  text-decoration: none;
}
@media (max-width: 680px) {
  .mini-foot { padding: 0 14px 20px; font-size: 12px; }
  .mini-foot-in { flex-direction: column; align-items: flex-start; gap: 10px; }
}
