/* 迟北 — 颜色、大小大多只要改 :root 这段 */
:root {
  --paper:  #FAF6EE;   /* 画纸 */
  --ink:    #2F3558;   /* 文字 */
  --soft:   #5F6385;   /* 次要文字 */
  --indigo: #4B5BB5;   /* 蜡笔：靛蓝 */
  --yellow: #F2B33D;   /* 蜡笔：毛线黄 */
  --lilac:  #8E78DA;   /* 蜡笔：火焰紫 */
  --aurora: #2FA37E;   /* 蜡笔：极光绿 */
  --ember:  #EE8243;   /* 蜡笔：小火光 */

  --size: clamp(112px, 34vw, 150px);   /* 迟北的大小 */
  --page: 34rem;                       /* 内容最大宽度 */
  --font: "Xiaolai Page", "Xiaolai SC", "HanziPen SC", "Yuanti SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --hand: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --wax: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 -2.4 1.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .38  0 0 0 0 .3  0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
h1, h2 { font-weight: 400; line-height: 1.35; word-break: keep-all; overflow-wrap: break-word; }
p { text-wrap: pretty; }

:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 6px; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.wax { background-image: var(--wax); }

/* ---------- 上方列 ---------- */
.top {
  position: fixed;
  z-index: 20;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem 1.1rem;
  padding-top: max(.5rem, env(safe-area-inset-top));
  background: linear-gradient(rgba(250, 246, 238, .96) 50%, rgba(250, 246, 238, 0));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: .12em;
  text-decoration: none;
}
.top-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.1rem;
  border-radius: var(--hand);
  background: var(--wax), #D8E6F6;
  color: var(--ink);
  text-decoration: none;
}

/* ---------- 每一段 ----------
   叠放：毛线 1、星与迟北 2、线稿与文字 3、对话泡泡 6 */
.world { position: relative; z-index: 1; }

.thread {
  position: absolute;
  z-index: 1;
  left: 0; top: 0;
  overflow: visible;
  pointer-events: none;
}
.thread path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.thread .under { stroke: var(--yellow); stroke-width: 6; opacity: .35; }
.thread .over { stroke: #DB9420; stroke-width: 3.2; }

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  max-width: var(--page);
  margin: 0 auto;
  padding: 5rem 1.5rem 6rem;
}

.scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: calc(var(--size) + 3.5rem);
  flex: none;
}
.scene.left { flex-direction: row-reverse; }
.scene.center { justify-content: center; height: calc(var(--size) * 1.55 + 2rem); }

.night {
  position: absolute;
  left: 50%; bottom: -.5rem;
  width: calc(var(--size) * 2.3);
  height: auto;
  transform: translateX(-50%);
  overflow: visible;
}

.spot {
  position: relative;
  z-index: 2;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--size);
  height: 1.5rem;
}
.spot::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  box-shadow:
    0 -18px 0 var(--yellow), 13px -13px 0 var(--lilac), 18px 0 0 var(--aurora), 13px 13px 0 var(--ember),
    0 18px 0 var(--yellow), -13px 13px 0 var(--lilac), -18px 0 0 var(--aurora), -13px -13px 0 var(--ember);
  opacity: 0;
  pointer-events: none;
}
.spot svg {
  width: 22px; height: 22px;
  overflow: visible;
  fill: var(--paper);
  stroke: var(--indigo);
  stroke-width: 2;
  stroke-linejoin: round;
  transition: fill .3s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.passed .spot svg { fill: var(--yellow); transform: scale(1.3) rotate(15deg); }

.sketch {
  position: relative;
  z-index: 3;
  width: clamp(100px, 29vw, 132px);
  height: auto;
  margin-bottom: .2rem;
  color: var(--q);
  overflow: visible;
  cursor: pointer;
}
.sketch * {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 文字 ---------- */
.copy { position: relative; z-index: 3; margin-top: 1.5rem; }

.hero .copy { flex: 1; display: flex; flex-direction: column; }
.hero h1 { font-size: clamp(2.3rem, 10.5vw, 3.2rem); line-height: 1.3; letter-spacing: .03em; margin-bottom: 1rem; }
.lead { color: var(--soft); }
.lead + .lead { margin-top: .4rem; }
.hero .btn { margin-top: auto; }

.copy h2 { font-size: 1.9rem; letter-spacing: .02em; }
.copy h2::after {
  content: "";
  display: block;
  width: 3.4em;
  height: .34em;
  margin: .2em 0 1.1rem;
  background: var(--q);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.3 .9' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.2 1.9'/%3E%3CfeComposite in='SourceGraphic' operator='in'/%3E%3C/filter%3E%3Cpath d='M5 12C45 6 85 15 125 9C155 5 178 11 195 8' stroke='%23000' stroke-width='9' stroke-linecap='round' fill='none' filter='url(%23c)'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.3 .9' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.2 1.9'/%3E%3CfeComposite in='SourceGraphic' operator='in'/%3E%3C/filter%3E%3Cpath d='M5 12C45 6 85 15 125 9C155 5 178 11 195 8' stroke='%23000' stroke-width='9' stroke-linecap='round' fill='none' filter='url(%23c)'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  opacity: .8;
}
.copy p + p { margin-top: .9rem; }

.thoughts {
  position: relative;
  list-style: none;
  margin: 0 0 1.4rem;
  padding: .1rem 0 .1rem 1.1rem;
  color: var(--soft);
}
.thoughts::before {
  content: "";
  position: absolute;
  left: 0; top: .3rem; bottom: .3rem;
  width: 4px;
  border-radius: 4px;
  background: var(--wax), var(--q);
  opacity: .75;
}
.thoughts li + li { margin-top: .3rem; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 1.5rem;
  border-radius: var(--hand);
  background-color: var(--yellow);
  color: var(--ink);
  font-size: 1.25rem;
  letter-spacing: .14em;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform .1s ease-out;
}
.btn:active, .top-link:active { transform: scale(.96); }

/* ---------- 钩织插画 ---------- */
.knit { position: relative; width: min(100%, 18rem); margin: 1.8rem auto; }
.knit img { border-radius: 4px; transform: rotate(-1.5deg); box-shadow: 0 10px 24px rgba(47, 53, 88, .16); }
.knit::before, .qr::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -.7rem; left: 50%;
  width: 5.5rem; height: 1.6rem;
  margin-left: -2.75rem;
  background: var(--wax), rgba(169, 150, 236, .55);
  transform: rotate(-3deg);
}
.knit figcaption { margin-top: 1rem; color: var(--soft); font-size: .9375rem; text-align: center; }

/* ---------- 对话框 ---------- */
.dialog {
  position: relative;
  margin-top: .6rem;
  min-height: 12rem;
  padding: 1.5rem 1.1rem 2.6rem 6.6rem;
  border-radius: var(--hand);
  background-color: #ECE7FA;
  transform: rotate(-.4deg);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.dialog-name {
  position: absolute;
  left: 1.2rem; top: -1rem;
  padding: 0 .9rem;
  border-radius: 12px 16px 10px 14px;
  background-color: var(--yellow);
  line-height: 1.85;
  transform: rotate(-2deg);
}
.dialog-face {
  position: absolute;
  left: .9rem; top: 1.4rem;
  width: 4.75rem; height: 4.75rem;
  padding: .25rem;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}
.dialog-line { min-height: 5.5em; }
.dialog-next {
  position: absolute;
  right: .5rem; bottom: .2rem;
  display: flex;
  align-items: center;
  min-width: 48px; min-height: 44px;
  padding: 0 .6rem;
  background: none;
  border: 0;
  color: var(--soft);
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
}
.dialog-next i {
  width: 0; height: 0;
  margin-left: .55rem;
  border: 7px solid transparent;
  border-top: 10px solid var(--lilac);
  border-bottom: 0;
}
.dialog-src { padding-left: 1.2em; }
.js .dialog-src { display: none; }
html:not(.js) .dialog-line, html:not(.js) .dialog-next { display: none; }

/* ---------- 联系 ---------- */
.follow { display: flex; gap: 1rem; margin-top: 1.8rem; }
.qr {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 1rem .7rem .7rem;
  border-radius: var(--hand);
  background-color: #fff;
  text-align: center;
  box-shadow: 0 6px 16px rgba(47, 53, 88, .1);
}
.qr:nth-child(1) { transform: rotate(-1.2deg); }
.qr:nth-child(2) { transform: rotate(1deg); }
.qr::before { background: var(--wax), rgba(242, 179, 61, .5); }
.qr figcaption { margin-bottom: .5rem; }
.qr img { width: 100%; border-radius: 4px; }
.copy-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  margin-top: .5rem;
  padding: 0 .6rem;
  border: 2px dashed #B9BCD3;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .2s;
}
.copy-id b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.copy-id span { flex: none; margin-left: .5rem; color: var(--soft); }
.copy-id.done { background-color: #DDF2E9; }
.copy-id.done span { color: var(--aurora); }
.hint { margin-top: 1.4rem; color: var(--soft); font-size: .9375rem; }

/* ---------- 页脚 ---------- */
.foot { position: relative; z-index: 1; color: var(--soft); font-size: .875rem; text-align: center; }
.hem {
  height: 30px;
  background: repeat-x left bottom / 24px 30px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='30' fill='none' stroke='%23E0A126' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M3 4C6 12 9 20 12 27M21 4C18 12 15 20 12 27'/%3E%3C/svg%3E");
  opacity: .8;
}
.foot p { padding: 1rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); }

/* ---------- 迟北 ----------
   位置由 main.js 控制；这里是漂浮、火焰、触手、打瞌睡 */
.chibei {
  position: absolute;
  z-index: 2;
  left: 0; top: 0;
  width: var(--size);
  height: var(--size);
  padding: 0;
  border: 0;
  background: none;
  transform-origin: 50% 100%;
  will-change: transform;
  cursor: pointer;
  touch-action: manipulation;
  visibility: hidden;
}
.chibei.ready { visibility: visible; }
.chibei svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 100%; will-change: transform; }
.chibei .flame, .chibei .tendril, .chibei .glow { transform-box: fill-box; }
.chibei .flame { transform-origin: 30% 100%; transition: transform .4s; }
.chibei .tendril.l { transform-origin: 100% 30%; transition: transform .3s ease-out; }
.chibei .tendril.r { transform-origin: 0 30%; transition: transform .3s ease-out; }
.chibei .glow { transform-origin: 50% 50%; }
.chibei.moving .tendril.l { transform: rotate(16deg); }
.chibei.moving .tendril.r { transform: rotate(-16deg); }

.whoosh {
  position: absolute;
  left: 50%; top: 55%;
  width: 0; height: 0;
  transform: rotate(var(--a, 90deg));
  opacity: 0;
  pointer-events: none;
}
.whoosh i {
  position: absolute;
  right: calc(var(--size) * .42);
  height: 4px;
  border-radius: 4px;
  background: var(--wax), var(--indigo);
  opacity: .55;
}
.whoosh i:nth-child(1) { top: -16px; width: 26px; }
.whoosh i:nth-child(2) { top: -2px; width: 42px; right: calc(var(--size) * .46); }
.whoosh i:nth-child(3) { top: 12px; width: 22px; }

.puff i {
  position: absolute;
  bottom: 2%;
  width: 20%;
  aspect-ratio: 1.5;
  border-radius: 50% 50% 45% 55%;
  background: var(--wax), #DDE3F5;
  opacity: 0;
  pointer-events: none;
}
.puff i:first-child { left: 18%; }
.puff i:last-child { right: 18%; }

.sfx {
  position: absolute;
  z-index: 5;
  color: var(--ember);
  font-size: calc(var(--size) * .2);
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  text-shadow: 2px 0 var(--paper), -2px 0 var(--paper), 0 2px var(--paper), 0 -2px var(--paper);
}

.zz {
  position: absolute;
  left: 14%; top: -2%;
  color: var(--indigo);
  font-size: calc(var(--size) * .16);
  line-height: 1;
  pointer-events: none;
}
.zz i { position: absolute; font-style: normal; opacity: 0; }
.zz i + i { left: -.7em; top: -.9em; font-size: .75em; }

.bubble {
  position: absolute;
  z-index: 6;
  left: 0; top: 0;
  max-width: 16rem;
  padding: .45rem .95rem;
  border-radius: var(--hand);
  background-color: #fff;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(47, 53, 88, .14);
  line-height: 1.6;
  pointer-events: none;
  opacity: 0;
  transform: scale(.9);
  transform-origin: 50% 100%;
  transition: opacity .15s, transform .15s;
}
.bubble.show { opacity: 1; transform: none; }

/* ---------- 背景小涂鸦 ----------
   每张图是横排的 2～3 格动画（--n 格），图在 img/doodles/ */
.land {
  position: absolute;
  z-index: 0;
  top: 0; bottom: 0;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  overflow: hidden;
  pointer-events: none;
}
.d {
  position: absolute;
  bottom: 1.15rem;
  width: var(--w);
  aspect-ratio: var(--r);
  background: 0 0 / calc(var(--n) * 100%) 100% no-repeat;
}
.d[style*="top"] { bottom: auto; }
.d.wide { display: none; }
@media (min-width: 900px) { .d.wide { display: block; } }
.d-sun       { --w: 64px; --r: 1;       --n: 2; --t: 1.6s; background-image: url(img/doodles/sun.svg); }
.d-moon      { --w: 54px; --r: 1;       --n: 2; --t: 2.4s; background-image: url(img/doodles/moon.svg); }
.d-cloud     { --w: 88px; --r: 96 / 56; --n: 2; --t: 1.8s; background-image: url(img/doodles/cloud.svg); }
.d-bird      { --w: 40px; --r: 46 / 26; --n: 2; --t: .5s;  background-image: url(img/doodles/bird.svg); }
.d-flower    { --w: 30px; --r: 40 / 66; --n: 3; --t: 1.5s; background-image: url(img/doodles/flower.svg); }
.d-butterfly { --w: 38px; --r: 44 / 36; --n: 2; --t: .4s;  background-image: url(img/doodles/butterfly.svg); }
.d-snail     { --w: 58px; --r: 70 / 40; --n: 2; --t: 1.2s; background-image: url(img/doodles/snail.svg); }
.d-yarn      { --w: 40px; --r: 50 / 48; --n: 3; --t: 1.2s; background-image: url(img/doodles/yarn.svg); }
.ground {
  position: absolute;
  left: 0; right: 0; bottom: .6rem;
  height: 38px;
  background: url(img/doodles/grass.svg) 0 0 / 100px 76px repeat-x;
  opacity: .9;
}

/* ---------- 点纸留下的小记号 ---------- */
.marks { position: fixed; z-index: 15; inset: 0; pointer-events: none; overflow: hidden; }
.marks i {
  position: absolute;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  background: var(--wax), var(--c);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.marks i.small { width: 10px; height: 10px; margin: -5px 0 0 -5px; }

/* ---------- 动画（系统打开「减少动态效果」时不播放） ---------- */
@media (prefers-reduced-motion: no-preference) {
  .d { animation: frames var(--t) steps(var(--n), jump-none) infinite; }
  .d:nth-child(2n) { animation-delay: -.4s; }
  .d:nth-child(3n) { animation-delay: -.9s; }
  @keyframes frames { to { background-position-x: 100%; } }
  .d-butterfly { animation: frames var(--t) steps(2, jump-none) infinite, flutter 3.4s ease-in-out infinite; }
  @keyframes flutter { 50% { transform: translate(14px, -10px); } }
  .d-bird { animation: frames var(--t) steps(2, jump-none) infinite, glide 6s ease-in-out infinite; }
  @keyframes glide { 50% { transform: translate(18px, -6px); } }
  .d-snail { animation: frames var(--t) steps(2, jump-none) infinite, crawl 24s ease-in-out infinite alternate; }
  @keyframes crawl { to { transform: translateX(70px); } }
  .ground { animation: sway 1.6s steps(2, jump-none) infinite; }
  @keyframes sway { to { background-position-y: 100%; } }

  .chibei.ready { animation: appear 1s ease-out; }
  @keyframes appear { from { opacity: 0; } }

  .chibei.is-idle svg { animation: float 3.6s ease-in-out infinite; }
  @keyframes float { 50% { transform: translateY(-6px); } }
  .chibei .flame { animation: flicker 1.05s steps(1, end) infinite; }
  @keyframes flicker {
    33% { transform: scale(.93, 1.08) skewX(-5deg); }
    66% { transform: scale(1.05, .95) skewX(3deg); }
  }
  .chibei.is-idle .tendril.l { animation: sway-l 2.4s steps(1, end) infinite; }
  .chibei.is-idle .tendril.r { animation: sway-r 2.4s steps(1, end) infinite; }
  @keyframes sway-l { 50% { transform: rotate(6deg); } }
  @keyframes sway-r { 50% { transform: rotate(-6deg); } }
  .chibei .glow { animation: pulse 2.4s steps(1, end) infinite; }
  @keyframes pulse { 50% { transform: scale(1.3); opacity: .55; } }

  .chibei.crouch svg { animation: crouch .16s ease-out forwards; }
  @keyframes crouch { to { transform: scale(1.14, .82); } }
  .chibei.touchdown svg { animation: touchdown .5s ease-out; }
  @keyframes touchdown {
    0%   { transform: scale(.9, 1.12); }
    35%  { transform: scale(1.18, .8); }
    65%  { transform: scale(.96, 1.05); }
    100% { transform: none; }
  }
  .chibei.moving .flame { animation: blaze .3s steps(1, end) infinite; }
  @keyframes blaze {
    0%  { transform: scale(1.2, 1.4) skewX(-14deg); }
    50% { transform: scale(1.3, 1.25) skewX(-6deg); }
  }
  .chibei.moving .whoosh { opacity: 1; }
  .chibei.moving .whoosh i { animation: whoosh .24s steps(1, end) infinite; }
  .chibei.moving .whoosh i:nth-child(2) { animation-delay: -.12s; }
  @keyframes whoosh { 50% { transform: translateX(-6px) scaleX(.7); } }
  .chibei.touchdown .puff i { animation: puff-r .5s steps(3, end); }
  .chibei.touchdown .puff i:first-child { animation-name: puff-l; }
  @keyframes puff-l {
    0%   { opacity: 1; transform: translate(0, 0) scale(.5); }
    100% { opacity: 0; transform: translate(-130%, -40%) scale(1.2); }
  }
  @keyframes puff-r {
    0%   { opacity: 1; transform: translate(0, 0) scale(.5); }
    100% { opacity: 0; transform: translate(130%, -40%) scale(1.2); }
  }
  .sfx { animation: sfx .8s steps(4, end) forwards; }
  @keyframes sfx {
    0%   { opacity: 1; transform: scale(.4) rotate(-12deg); }
    25%  { opacity: 1; transform: scale(1.25) rotate(-6deg); }
    50%  { opacity: 1; transform: scale(1) rotate(-8deg) translateY(-6px); }
    100% { opacity: 0; transform: scale(1) rotate(-8deg) translateY(-14px); }
  }
  .passed .spot::before { animation: burst .6s steps(3, end); }
  @keyframes burst {
    0%   { opacity: 1; transform: scale(.35); }
    60%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.4); }
  }
  .js .landed .sketch { animation: wiggle .5s 1.3s ease-in-out; }
  .chibei.hop svg { animation: hop .5s cubic-bezier(.3, 0, .4, 1); }
  @keyframes hop {
    0%   { transform: scale(1.08, .9); }
    40%  { transform: translateY(-20%) scale(.96, 1.06); }
    80%  { transform: scale(1.05, .94); }
    100% { transform: none; }
  }
  .chibei.hop .flame { animation: flare .5s steps(3, end); }
  @keyframes flare { 50% { transform: scale(1.45); } }

  .chibei.dozing svg { animation: float 6s ease-in-out infinite; }
  .chibei.dozing .flame { animation: none; transform: scale(.6, .55); }
  .chibei.dozing .tendril.l { animation: none; transform: rotate(-8deg); }
  .chibei.dozing .tendril.r { animation: none; transform: rotate(8deg); }
  .chibei.dozing .zz i { animation: zz 2.6s ease-in-out infinite; }
  .chibei.dozing .zz i + i { animation-delay: 1.3s; }
  @keyframes zz {
    0%   { opacity: 0; transform: translate(0, 4px); }
    30%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-10px, -16px); }
  }
  .chibei.stretch svg { animation: stretch .6s cubic-bezier(.3, 1.4, .5, 1); }
  @keyframes stretch { 40% { transform: scale(.92, 1.12); } }

  .night .twinkle use { transform-box: fill-box; transform-origin: center; animation: twinkle 3.2s steps(1, end) infinite; }
  .night .twinkle use:nth-child(2) { animation-delay: -1.1s; }
  .night .twinkle use:nth-child(3) { animation-delay: -2.2s; }
  .night .twinkle use:nth-child(4) { animation-delay: -.6s; }
  @keyframes twinkle { 50% { transform: scale(.7) rotate(20deg); } }

  .js .sketch { opacity: 0; }
  .js .landed .sketch { opacity: 1; }
  .js .sketch * {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.2s cubic-bezier(.6, 0, .2, 1);
  }
  .js .sketch g > :nth-child(2) { transition-delay: .2s; }
  .js .sketch g > :nth-child(3) { transition-delay: .4s; }
  .js .sketch g > :nth-child(4) { transition-delay: .6s; }
  .js .sketch g > :nth-child(n+5) { transition-delay: .8s; }
  .js .landed .sketch * { stroke-dashoffset: 0; }
  .js .landed .sketch.redo { animation: wiggle .5s ease-in-out; }
  .js .landed .sketch.redo g > * { animation: redraw 1s cubic-bezier(.6, 0, .2, 1) both; }
  @keyframes redraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes wiggle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(3deg); } }

  .js .copy h2::after { clip-path: inset(0 100% 0 0); transition: clip-path .6s .2s cubic-bezier(.6, 0, .2, 1); }
  .js .landed .copy h2::after { clip-path: inset(0 -5% 0 0); }

  @media (hover: hover) {
    .btn:hover, .top-link:hover { animation: wiggle .4s ease-in-out; }
  }
  .dialog.talking .dialog-face { animation: talk .36s steps(2, end) infinite; }
  @keyframes talk { 50% { transform: translateY(-3px) rotate(-3deg); } }
  .dialog:not(.talking) .dialog-next i { animation: nudge 1.4s ease-in-out infinite; }
  @keyframes nudge { 50% { transform: translateY(3px); } }

  .marks i { animation: mark .7s ease-out forwards; }
  @keyframes mark {
    0%   { transform: scale(.2) rotate(0); opacity: 1; }
    40%  { transform: scale(1.1) rotate(25deg); opacity: 1; }
    100% { transform: scale(.9) rotate(40deg); opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bubble { transition: none; }
  .marks { display: none; }
}
