/* B2 poster composition: keep characters solid, crop at the section edge. */
:root {
  --night:#19191e; --night-2:#232329; --night-3:#303038;
  --moon:#faf6f7; --moon-2:#ddd4d8; --moon-3:#b9abb2;
  --blush:#e6a7b7; --glass:rgba(25,25,30,.96);
  --scene-veil:rgba(25,25,30,.92);
}
:root[data-theme="light"] {
  --night:#f5f8f7; --night-2:#fff; --night-3:#e4efeb;
  --moon:#3d3039; --moon-2:#655360; --moon-3:#776570;
  --blush:#a54f69; --glass:rgba(248,251,250,.96);
  --scene-veil:rgba(247,250,249,.94);
}
* { letter-spacing:0 !important; }
.sky { background:var(--night); }
.grain,.rings,.moon { display:none; }
header { background:var(--glass); border-bottom-color:var(--line); }
.hero-scene { position:relative; isolation:isolate; overflow:hidden; border-bottom:1px solid var(--line); }
.scene-background {
  position:absolute; inset:0; z-index:-2; pointer-events:none;
  background-size:auto 245%; background-position:right top; background-repeat:no-repeat;
  background-color:var(--night); transition:opacity .55s;
}
.scene-background.for-light { background-image:var(--scene-light, none); opacity:0; }
.scene-background.for-dark { background-image:var(--scene-dark, none); opacity:0; }
:root[data-art-theme="light"] .scene-background.for-light,
:root[data-art-theme="dark"] .scene-background.for-dark { opacity:1; }
.hero-scene::after {
  content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background:linear-gradient(90deg,var(--scene-veil) 0%,var(--scene-veil) 34%,transparent 86%);
}
.hero {
  min-height:640px; height:min(800px,92svh); display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:32px;
  padding:108px 0 0;
}
.hero-text { align-self:center; min-width:0; padding-bottom:76px; }
.who { display:block; margin-top:16px; }
.who .avatar { display:none; }
.name { font-size:54px; white-space:nowrap; }
.name .en { margin-left:0; }
.hero .lead { font-size:16px; max-width:30em; line-height:1.85; margin-top:28px; }
.hero-note { color:var(--moon-2); max-width:29em; font-size:14px; line-height:1.85; margin:14px 0 0; opacity:0; animation:fade 1s .9s forwards; }
.supporter-credit { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; }
.supporter-credit strong { font-weight:500; }
.supporter-links { display:inline-flex; flex-wrap:wrap; align-items:center; gap:14px; }
.supporter-links a { color:var(--blush); text-decoration:underline; text-underline-offset:4px; }
.supporter-links a:focus-visible { outline:2px solid currentColor; outline-offset:4px; }
.supporter-pending { color:var(--moon-3); font-size:12px; }
.hero .plats { margin-top:30px; gap:8px; }
.plat { display:inline-flex; align-items:center; gap:9px; padding:10px 14px; font-size:14px; }
.social-icon { width:19px; height:19px; flex:none; display:block; }
.social-arrow { font-size:13px; opacity:.65; }
.social-bili .social-icon { color:#24a5e6; }
.social-douyin .social-icon { color:#d54b7d; }
.social-kuaishou .social-icon { color:#ff8a3d; }
.social-github .social-icon { color:var(--moon); }
.social-github:hover .social-icon { color:var(--night); }
.plat[data-link-pending] { cursor:default; }
.stage {
  position:relative; isolation:isolate; align-self:stretch; justify-self:stretch;
  width:100%; height:100%; min-width:0; max-height:none; aspect-ratio:auto; perspective:none;
}
.stage .figure { display:block; inset:0 -3% 0; transform:none !important; transform-style:flat; }
.stage .portrait-motion { position:absolute; top:0; left:0; width:100%; aspect-ratio:2/3; }
.stage .character-art {
  position:absolute; top:0; left:0; width:100%; height:auto; max-width:none;
  display:block; object-fit:contain; object-position:center top;
  transform:none;
  transform-origin:center top; user-select:none;
  filter:none; mask-image:none; -webkit-mask-image:none;
}
.stage .character-art:not([src]) { display:none; }
.stage .character-art.art-loading { opacity:0; }
.hero-enhanced .stage .character-art { opacity:0; transition:opacity 1.1s ease .1s; }
.stage .figure.art-ready .character-art { opacity:1; }
.scroll { bottom:24px; }
h2 { font-size:48px; }
.door,.clip,.tool,.skill { border-radius:8px; }
/* Keep the mascot in its own space above the entry text. */
#entrances { scroll-margin-top:110px; }
.door.fans { --mascot-art:url("assets/emotes/up-day-v2.webp"); --entry-accent:#eab0c0; --tint:rgba(225,145,170,.25); }
.door.shop { --mascot-art:url("assets/emotes/shop-night-v2.webp"); --entry-accent:#dfbb80; --tint:rgba(218,175,104,.25); }
.door.makers { --mascot-art:url("assets/emotes/toolbox-v3.webp"); --entry-accent:#8bcabb; --tint:rgba(104,190,168,.25); }
.door.soft { --mascot-art:url("assets/emotes/software-night-v2.webp"); --entry-accent:#9dbde9; --tint:rgba(126,169,223,.25); }
:root[data-theme="light"] .door.fans { --entry-accent:#995269; }
:root[data-theme="light"] .door.shop { --entry-accent:#89652d; }
:root[data-theme="light"] .door.makers { --entry-accent:#337b6b; }
:root[data-theme="light"] .door.soft { --entry-accent:#496f9c; }
.emote-door {
  background:color-mix(in srgb,var(--entry-accent) 5%,var(--night-2));
  border-color:color-mix(in srgb,var(--entry-accent) 22%,var(--line));
}
.emote-door .no,.emote-door .go { color:var(--entry-accent); }
.emote-door .go b { border-color:color-mix(in srgb,var(--entry-accent) 40%,var(--line-2)); }
.emote-door:is(:hover,:focus-visible) { border-color:var(--entry-accent); }
.emote-door:is(:hover,:focus-visible)::before { opacity:1; }
.emote-door:is(:hover,:focus-visible) .go b { background:var(--entry-accent); border-color:var(--entry-accent); color:var(--night); }
.doors.four .emote-door {
  min-height:360px;
  padding-top:180px;
}
.emote-door::after {
  content:"";
  position:absolute;
  inset:-24px;
  z-index:-2;
  pointer-events:none;
  background:var(--mascot-art) right -20px top -32px / 320px auto no-repeat;
  filter:blur(18px);
  opacity:.23;
  -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 35%,transparent 80%);
  mask-image:linear-gradient(to bottom,#000 0%,#000 35%,transparent 80%);
}
:root[data-theme="light"] .emote-door::after { opacity:.15; }
.door-mascot {
  position:absolute;
  top:12px;
  right:12px;
  width:160px;
  max-width:calc(100% - 64px);
  height:auto;
  aspect-ratio:1;
  object-fit:contain;
  pointer-events:none;
  transform-origin:50% 85%;
  transition:transform .3s ease;
}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .emote-door:hover .door-mascot { transform:translateY(-4px) rotate(3deg); }
}
.emote-door:focus-visible { outline:2px solid var(--entry-accent); outline-offset:4px; }
@media(max-width:760px) {
  .doors.four .emote-door { min-height:320px; padding:140px 16px 22px; }
  .doors.four .emote-door .no { left:16px; }
  .emote-door .door-mascot { width:112px; top:16px; right:8px; }
  .emote-door::after { background-size:240px auto; filter:blur(14px); }
  .doors.four .emote-door h3 { font-size:20px; overflow-wrap:anywhere; }
}
@media(min-width:1600px) { .hero { height:800px; } }
@media(max-width:1100px) {
  .name { font-size:44px; }
  .hero { gap:16px; }
  .stage .figure { inset:18px -6% 0; }
}
@media(max-width:960px) {
  .hero { grid-template-columns:minmax(0,1fr) minmax(0,1fr); min-height:600px; height:82svh; }
  .name { font-size:36px; }
  .hero-text { padding-bottom:48px; }
  .stage .figure { inset:40px -10% 0; }
  .scroll { display:none; }
}
@media(max-width:760px) {
  .bar { flex-wrap:wrap; height:auto; min-height:96px; gap:4px 12px; padding:10px 0; }
  .logo { margin-right:auto; }
  .theme { order:1; }
  nav { order:2; width:100%; margin:0; justify-content:space-between; }
  .hero { height:auto; min-height:0; padding:120px 0 0; display:flex; flex-direction:column; gap:20px; }
  .hero-text { width:100%; padding:0; }
  .name { font-size:38px; }
  .hero .lead { margin-top:18px; }
  .hero-note { font-size:13px; margin-top:10px; }
  .hero .plats { margin-top:20px; }
  .plat { gap:7px; padding:9px 12px; }
  .stage { order:0; width:100%; height:340px; flex:none; max-height:none; }
  .stage .figure { inset:0; width:340px; max-width:100%; margin:0 auto; }
  .stage .character-art { transform:none; }
  .scene-background { background-size:auto 260%; background-position:75% top; }
  .hero-scene::after { background:linear-gradient(180deg,var(--scene-veil) 0%,var(--scene-veil) 43%,transparent 85%); }
  h2 { font-size:34px; }
}
@media(max-width:360px) { .name { font-size:32px; } .stage { height:295px; } }
@media(prefers-reduced-motion:reduce) {
  .scene-background,.figure,.character-art { transition:none !important; }
  .hero-note { opacity:1; }
  .stage .character-art { transform:none; }
}

/* A + B: preview and decoded art share the dolly; the outer layer breathes.
   Clarity comes from a preview crossfade, not an animated full-size blur. */
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  .hero-scene { --p: 0; --hero-mx: 0; --hero-my: 0; }

  /* 底子：人物放大到 2 倍，往画面中央挪（--hero-shift 是往左挪多少）。
     放大的中心定在头顶附近，免得兔耳朵顶到顶栏后面。 */
  .stage { --hero-shift: 2vw; }
  /* 人物放大后会伸到左边，文字和按钮要盖在人物上面，保证能看清、能点 */
  .hero-text { position: relative; z-index: 3; }
  .stage .portrait-motion {
    transform-origin: 50% 6%;
    transform: translateX(var(--hero-shift)) scale(2);
  }

  /* B 推镜 */
  .hero-enhanced .stage .portrait-motion:not(.art-entered) { scale:.86; opacity:.35; }
  .stage .portrait-motion.art-entered { animation: hm-dolly 1.6s cubic-bezier(.16, .8, .2, 1) .1s both; }
  .hero-scene.art-entered .scene-background { animation: hm-dolly-bg 1.7s cubic-bezier(.16, .8, .2, 1) both; }
  @keyframes hm-dolly { from { scale:.86; opacity:.35; } to { scale:1; opacity:1; } }
  @keyframes hm-dolly-bg { from { scale: 1.12; } to { scale: 1.03; } }

  .stage .figure.art-settled .portrait-motion { animation:none; scale:1; opacity:1; }
  .stage .figure.art-settled { animation:hm-breathe 5.5s ease-in-out infinite; }
  @keyframes hm-breathe { 0%, 100% { translate:0 0; } 50% { translate:0 -10px; } }
  .stage .figure.art-settled, .stage .portrait-motion.art-entered { animation-play-state:paused; }
  :root[data-art-theme="light"] .stage .figure.for-light,
  :root[data-art-theme="light"] .stage .figure.for-light .portrait-motion,
  :root[data-art-theme="dark"] .stage .figure.for-dark,
  :root[data-art-theme="dark"] .stage .figure.for-dark .portrait-motion { animation-play-state:running; }
  .hero-scene.hero-motion-paused .stage .figure,
  .hero-scene.hero-motion-paused .stage .portrait-motion,
  .hero-scene.hero-motion-paused .scene-background { animation-play-state:paused !important; }
  .scene-background { translate:calc(var(--hero-mx) * -26px) calc(var(--hero-my) * -14px); }

  /* D 景深：人物和背景一起虚掉、变暗 */
  .scene-background, .stage .figure { filter:none; }
  .hero-scene.has-depth .scene-background, .hero-scene.has-depth .stage .figure { filter: blur(calc(var(--p) * 6px)) brightness(calc(1 - var(--p) * .16)); }
  .scene-background { transition: opacity .55s, translate .6s cubic-bezier(.2, .8, .2, 1), filter .45s; }
  /* 人物那层还要管日夜切换的淡入淡出，所以把原来的过渡也写上，只多加一个 filter */
  .stage .figure { transition: opacity .6s cubic-bezier(.2, .8, .2, 1), visibility 0s .6s, filter .45s; }
  :root[data-art-theme="dark"] .stage .figure.for-dark,
  :root[data-art-theme="light"] .stage .figure.for-light { transition: opacity .6s cubic-bezier(.2, .8, .2, 1) .15s, visibility 0s, filter .45s; }
  .hero-text { opacity: calc(1 - var(--p) * 1.3); transition: opacity .4s; }
}

.clip-status { color:var(--moon-3); font-size:13px; line-height:1.6; margin:18px 0 0; }
.clips:empty { display:none; }

/* Fast transparent previews share the exact crop of the full portraits. */
.stage .portrait-motion::before {
  content:""; position:absolute; top:0; left:0; width:100%; aspect-ratio:2/3;
  background:center top / 100% auto no-repeat; pointer-events:none;
  transition:opacity 1.1s ease .1s;
}
.stage .figure.for-light .portrait-motion::before { background-image:url("assets/display/hero-day-preview.webp"); }
.stage .figure.for-dark .portrait-motion::before { background-image:url("assets/display/hero-night-preview.webp"); }
.stage .figure.art-ready .portrait-motion::before { opacity:0; }
#entrances { padding-bottom:40px; }
#fans { padding-top:40px; }
.tool.demo-played:not(.demo-complete) .blade { animation:sweep 2.6s var(--ease) forwards; }
.tool.demo-complete .blade { animation:none; transform:translateX(calc(var(--tw,520px) + 10px)); }
.tool:is(.demo-played,.demo-complete) .seg { opacity:1; background:rgba(255,154,168,.3); }
.tool:is(.demo-played,.demo-complete) .out { opacity:1; transform:none; border-style:solid; }
.tool.demo-reduced * { animation:none !important; transition:none !important; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .tool.demo-complete:hover .blade { animation:sweep-replay 2.6s var(--ease) forwards; }
}
@keyframes sweep-replay {
  from { transform:translateX(-10px); }
  to { transform:translateX(calc(var(--tw,520px) + 10px)); }
}
@media(max-width:760px) {
  .hero { padding-top:100px; gap:0; }
  /* A width-driven portrait crop keeps the face/hands stable on short screens.
     Fade the shared stage, including its preview, rather than cutting the dress. */
  .hero .stage {
    order:-1; width:min(380px,100%); height:auto; aspect-ratio:1 / 1.12;
    align-self:center; overflow:hidden;
    -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 76%,transparent 100%);
    mask-image:linear-gradient(to bottom,#000 0%,#000 76%,transparent 100%);
  }
  .hero .stage .figure { width:100%; inset:0; }
  .hero .stage .character-art, .hero .portrait-motion::before { transition-duration:.25s; transition-delay:0s; }
  .hero .hero-text { position:relative; z-index:1; margin-top:-24px; padding:0 0 32px; }
  .hero .eyebrow { display:none; }
  .hero .who { margin-top:0; }
  .hero .name { font-size:32px; }
  .hero .lead { margin-top:12px; }
  .hero .hero-note { animation:none; opacity:1; }
  .hero-scene::after {
    /* The introduction settles onto the page surface, with no floating panel. */
    background:linear-gradient(to bottom,transparent 180px,var(--scene-veil) 480px,var(--night) 650px);
  }
  #entrances { padding-bottom:24px; }
  #fans { padding-top:24px; }
}
@media(max-width:360px) { .hero .name { font-size:28px; } }
@media(prefers-reduced-motion:reduce) {
  .stage .portrait-motion::before { transition:none; }
  .tool .blade { animation:none !important; }
  .tool .seg,.tool .out { transition:none; }
}
