/* HANGFOOK 大陆官网首页 — 1:1 复刻 Figma "HANGFOOK 官网 · 首页与视差"，
   横向 100% 等比填满窗口，保留原有大陆下载源、底部介绍文案与粤ICP备2025410461号。 */

: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; font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif; }
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(714px * var(--s, 1)); }
html.is-desk #mobWrap, html.is-mob #deskWrap { 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: 714px; }

/* ---------- 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; }
.hv { will-change: transform; }
.b-body { position: absolute; inset: 0; transform-origin: var(--ox) var(--oy); }
.nav-line .pop { background: var(--ink); transform-origin: 0 50%; }

.hot {
  display: block; padding: 0; border: 0; background: transparent;
  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; }

/* ---------- Entrance (Q弹 pop-in) ---------- */
.pop {
  animation-duration: 1s;
  animation-delay: var(--d, 0ms);
  animation-fill-mode: both;
  animation-timing-function: linear;
}
html: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); } }

.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); }
}

/* ---------- Bottom Intro & ICP Filing (Preserved, Compact One-Screen) ---------- */
.hf-bottom {
  width: 100%;
  padding: 6px 16px 10px;
  text-align: center;
  background: var(--paper);
  color: #6d7066;
  font-size: 12px;
  line-height: 1.5;
}
.hf-home-intro { margin: 0 0 2px; font-weight: 600; color: #54574e; }
.hf-landing-footer { display: flex; justify-content: center; align-items: center; gap: 16px; }
.hf-landing-footer a { color: #7a7d73; text-decoration: none; }
.hf-landing-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Download Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  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(490px, 100%);
  max-height: 90vh; overflow-y: auto;
  padding: 26px 24px 22px;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  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 {
  width: 220px; 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-art.yellow { background: var(--yellow); }
.modal h2 { margin: 0 0 14px; font-size: 22px; 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); }

.dl-list { display: grid; gap: 12px; }
.dl-card {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 16px;
  padding: 13px 15px; display: flex; flex-direction: column; gap: 10px;
}
.dl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dl-head strong { font-size: 16px; }
.dl-head span { font-size: 12px; color: #676a61; font-weight: 700; }
.dl-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 14px;
  border: 2.5px solid var(--ink); border-radius: 14px;
  background: var(--blue); color: var(--ink);
  font-weight: 800; font-size: 14.5px; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .45s var(--spring), box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px) scale(1.03, .98); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(3px) scale(.96, 1.03); box-shadow: 0 1px 0 var(--ink); transition-duration: .12s; }
.btn.yellow { background: var(--yellow); }
.btn.backup { flex: 0 1 auto; background: #f2f1eb; font-size: 13px; }

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