/* ============================================================
   像素 · 月夜 —— 高级感深色像素风
   灵感：深夜月光下的像素旷野。克制用色 + 细腻微光 + 硬阴影
   ============================================================ */

:root {
  --bg0:      #07070f;   /* 最深的夜空 */
  --bg1:      #0d0e20;
  --panel:    rgba(18, 19, 38, .72);
  --panel-2:  #14152c;
  --line:     #2c2e52;   /* 面板描边 */
  --line-soft:#23253f;
  --cream:    #f3e9c8;   /* 月光白 —— 标题/强调 */
  --gold:     #e8c46a;   /* 塔罗金 */
  --gold-dim: rgba(232, 196, 106, .55);
  --cyan:     #8fd8e8;   /* 次级强调，克制使用 */
  --text:     #d9d7e8;
  --dim:      #a9abc6;
  --pink:     #d98fb8;
  --font-pixel: "Press Start 2P", monospace;
  --font-body:  -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ---------- 像素鼠标指针 ---------- */
html, body {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'><path d='M2 1 L2 13 L5.5 10 L8 15 L10 14 L7.5 9 L12 9 Z' fill='%23f3e9c8' stroke='%2307070f' stroke-width='1.6'/></svg>") 2 1, auto;
}
a, button, .tarot-scene, .hobby-card, .pub-card, .moon-wrap {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'><path d='M2 1 L2 13 L5.5 10 L8 15 L10 14 L7.5 9 L12 9 Z' fill='%23e8c46a' stroke='%2307070f' stroke-width='1.6'/></svg>") 2 1, pointer;
}
/* 月亮被正文盖住时，JS 会给 <html> 加 .moon-hot，让那块区域也显示金色手型 */
html.moon-hot, html.moon-hot body {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'><path d='M2 1 L2 13 L5.5 10 L8 15 L10 14 L7.5 9 L12 9 Z' fill='%23e8c46a' stroke='%2307070f' stroke-width='1.6'/></svg>") 2 1, pointer;
}

body {
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
}

/* ---------- 夜空层次 ---------- */
#starfield {
  position: fixed; inset: 0; z-index: -5;
  pointer-events: none;   /* 全屏背景层不拦截点击（月亮在两侧留白处仍需接收点击） */
  background:
    radial-gradient(ellipse at 78% 6%, rgba(60, 56, 110, .35) 0%, transparent 55%),
    radial-gradient(ellipse at 8% 100%, rgba(40, 32, 80, .3) 0%, transparent 50%),
    linear-gradient(to bottom, var(--bg0) 0%, var(--bg1) 60%, #11122a 100%);
}
.star { position: absolute; background: #fff; animation: twinkle var(--d, 3s) ease-in-out infinite alternate; }
.star.c { background: var(--cyan); }
.star.y { background: var(--cream); }
@keyframes twinkle { from { opacity: .12; } to { opacity: .9; } }

/* 流星 */
.shooting {
  position: fixed; z-index: -3;
  width: 110px; height: 2px;
  background: linear-gradient(to left, rgba(243, 233, 200, .95), transparent);
  pointer-events: none;
  animation: shoot 1.4s ease-out forwards;
}
@keyframes shoot {
  0%   { transform: rotate(-32deg) translateX(0);      opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: rotate(-32deg) translateX(340px);  opacity: 0; }
}

/* 像素月亮（JS 生成色块，此处负责光晕与浮动）；月亮/太阳本身即主题切换开关 */
.moon-wrap {
  position: fixed; z-index: -3;   /* 背景层：与流星/云朵同层，正文压在它上面；两侧留白处仍可点击切主题 */
  top: 7%; right: 9%;
  filter: drop-shadow(0 0 34px rgba(243, 233, 200, .32));
  animation: moonFloat 9s ease-in-out infinite alternate;
  pointer-events: auto;
}
@keyframes moonFloat { from { transform: translateY(0); } to { transform: translateY(14px); } }
#moon { display: grid; grid-auto-rows: 4px; }
#moon .row { display: flex; }
#moon .px { width: 4px; height: 4px; }
#moon .h  { background: #fff6d9; }   /* 高光 */
#moon .m  { background: var(--cream); }
#moon .k  { background: #ddcaa0; }   /* 亮暗过渡 */
#moon .s  { background: #c3a876; }   /* 暗部 */
#moon .d  { background: #9d8454; }   /* 深影 */
#moon .c  { background: #b39a68; }   /* 陨石坑底 */
#moon .r  { background: #fdf1d2; }   /* 坑沿高光 */
#moon .t  { background: transparent; }

/* 像素云 */
.cloud {
  position: fixed; z-index: -3;
  width: 14px; height: 14px;
  pointer-events: none;
  --cl: rgba(139, 141, 176, .13);
  background: var(--cl);
  box-shadow:
    14px 0 var(--cl), 28px 0 var(--cl),
    -14px 14px var(--cl), 0 14px var(--cl), 14px 14px var(--cl), 28px 14px var(--cl), 42px 14px var(--cl),
    -28px 28px var(--cl), -14px 28px var(--cl), 0 28px var(--cl), 14px 28px var(--cl), 28px 28px var(--cl), 42px 28px var(--cl), 56px 28px var(--cl);
  animation: drift linear infinite;
}
.cloud-1 { top: 16%; animation-duration: 150s; }
.cloud-2 { top: 34%; animation-duration: 220s; animation-delay: -80s; transform: scale(1.6); opacity: .7; }
@keyframes drift { from { left: -10%; } to { left: 110%; } }

/* 远山剪影（阶梯多边形） */
.mountains {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 130px; z-index: -2; pointer-events: none;
}
.mountains-back {
  background: #181a36;
  opacity: .8;
  clip-path: polygon(0 100%, 0 60%, 7% 60%, 7% 42%, 14% 42%, 14% 66%, 22% 66%, 22% 30%, 30% 30%, 30% 52%, 38% 52%, 38% 74%, 47% 74%, 47% 46%, 55% 46%, 55% 22%, 63% 22%, 63% 56%, 72% 56%, 72% 38%, 80% 38%, 80% 62%, 88% 62%, 88% 48%, 95% 48%, 95% 68%, 100% 68%, 100% 100%);
}
.mountains-front {
  height: 84px;
  background: #101128;
  clip-path: polygon(0 100%, 0 52%, 9% 52%, 9% 30%, 18% 30%, 18% 58%, 27% 58%, 27% 76%, 36% 76%, 36% 40%, 46% 40%, 46% 64%, 55% 64%, 55% 26%, 64% 26%, 64% 54%, 74% 54%, 74% 72%, 83% 72%, 83% 44%, 92% 44%, 92% 62%, 100% 62%, 100% 100%);
}

/* 胶片噪点 */
.grain {
  position: fixed; inset: 0; z-index: 60;
  pointer-events: none; opacity: .05;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* ---------- 鼠标星尘 ---------- */
#stardust { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.dust {
  position: absolute; width: 5px; height: 5px;
  background: var(--cream);
  animation: dustFade .55s ease-out forwards;
}
.dust.g { background: var(--gold); }
@keyframes dustFade {
  from { opacity: .9; transform: translateY(0) scale(1); }
  to   { opacity: 0;  transform: translateY(-14px) scale(.3); }
}

/* ---------- 布局 ---------- */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 22px 120px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

/* ---------- 导航 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 24px;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0;
  background: rgba(7, 7, 15, .68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line-soft);
}
.nav-logo { color: var(--gold); }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--dim); text-decoration: none; transition: color .15s; }
.nav-links a:hover { color: var(--cream); text-shadow: 0 0 12px rgba(243, 233, 200, .5); }
.nav-links a.active { color: var(--gold); text-shadow: 0 0 12px rgba(232, 196, 106, .32); }
.nav-links a.active::before { content: "· "; color: var(--gold); }

/* ---------- HERO ---------- */
.hero {
  display: flex;
  gap: clamp(40px, 7vw, 92px);
  align-items: center;
  flex-wrap: wrap;
  padding: 52px 8px 12px;
}
.hero-info { flex: 1 1 460px; min-width: 280px; }
.hero-hello {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0;
  color: var(--cyan);
  margin-bottom: 18px;
  opacity: .85;
}
.pixel-title {
  font-family: var(--font-pixel);
  font-size: 28px;
  color: var(--cream);
  letter-spacing: 0;
  text-shadow: 0 0 22px rgba(243, 233, 200, .28);
  margin-bottom: 16px;
}
.tagline { font-size: 17px; font-weight: 600; color: var(--cyan); min-height: 1.5em; margin-bottom: 14px; }
.hero-summary { max-width: 560px; font-size: 17px; line-height: 1.6; color: var(--text); margin-bottom: 20px; }
.hero-summary:empty { display: none; }
.cursor { animation: blink .9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.stat-list { list-style: none; margin-bottom: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.stat-list li { margin: 5px 0; font-size: 14px; }
.stat-list .k {
  display: inline-block; min-width: 82px;
  color: var(--dim);
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0;
  vertical-align: middle;
}
.stat-list a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--dim); }
.stat-list a:hover { color: var(--cream); }

/* 研究方向 chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--cyan);
  border: 1px solid rgba(143, 216, 232, .35);
  padding: 4px 8px;
  background: rgba(143, 216, 232, .06);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions a {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 42px; padding: 9px 14px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}
.hero-actions a:hover { transform: translateY(-2px); }
.hero-action-primary { color: var(--bg0); background: var(--gold); border: 1px solid var(--gold); }
.hero-action-secondary { color: var(--cream); border: 1px solid var(--line); background: rgba(18, 19, 38, .75); }
.hero-action-secondary:hover { border-color: var(--gold); }

/* ============================================================
   塔罗牌
   ============================================================ */
.tarot-scene {
  position: relative;
  flex: 0 0 auto;
  perspective: 1100px;
  animation: cardFloat 5.5s ease-in-out infinite alternate;
}
@keyframes cardFloat { from { transform: translateY(-6px); } to { transform: translateY(8px); } }

.tarot-tilt { transform-style: preserve-3d; transition: transform .45s ease-out; }
.tarot-scene:hover .tarot-tilt { transition: transform .08s linear; }

.tarot-card {
  position: relative;
  width: 236px; height: 378px;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.3, .9, .3, 1);
}
.tarot-card.flipped { transform: rotateY(180deg); }

.tarot-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: linear-gradient(165deg, #1d1735 0%, #120f26 55%, #0e0c20 100%);
  border: 3px solid var(--gold);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6),
    0 0 44px rgba(232, 196, 106, .12),
    14px 18px 0 rgba(0, 0, 0, .35);
  transition: box-shadow .3s;
}
.tarot-scene:hover .tarot-face {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6),
    0 0 64px rgba(232, 196, 106, .32),
    18px 26px 0 rgba(0, 0, 0, .3);
}
.tarot-back { transform: rotateY(180deg); }

/* 四角金色像素铆钉（box-shadow 一次画 4 个角） */
.tarot-face::before {
  content: ""; position: absolute;
  top: 7px; left: 7px; width: 6px; height: 6px;
  background: var(--gold);
  box-shadow: 216px 0 var(--gold), 0 358px var(--gold), 216px 358px var(--gold);
}

.tarot-border-inner {
  position: absolute; inset: 16px;
  border: 1px solid var(--gold-dim);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 12px;
}
.tarot-top {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-pixel); font-size: 10px;
  color: var(--gold); letter-spacing: 2px;
  margin-bottom: 14px;
}
.tarot-star { font-size: 8px; opacity: .8; }

/* 像素圆形照片：外圈金色像素环 + 阶梯圆 clip-path（与月亮同款像素圆语言） */
.tarot-photo-ring {
  position: relative;
  width: 180px; height: 180px;
  margin: 6px auto 0;
  background: linear-gradient(160deg, var(--gold) 0%, #c9a24f 55%, #8a6d2f 100%);
  clip-path: polygon(63.89% 0.00%, 63.89% 2.78%, 72.22% 2.78%, 72.22% 5.56%, 77.78% 5.56%, 77.78% 8.33%, 80.56% 8.33%, 80.56% 11.11%, 83.33% 11.11%, 83.33% 13.89%, 86.11% 13.89%, 86.11% 16.67%, 88.89% 16.67%, 88.89% 19.44%, 91.67% 19.44%, 91.67% 22.22%, 94.44% 22.22%, 94.44% 25.00%, 94.44% 25.00%, 94.44% 27.78%, 97.22% 27.78%, 97.22% 30.56%, 97.22% 30.56%, 97.22% 33.33%, 100.00% 33.33%, 100.00% 36.11%, 100.00% 36.11%, 100.00% 38.89%, 100.00% 38.89%, 100.00% 41.67%, 100.00% 41.67%, 100.00% 44.44%, 100.00% 44.44%, 100.00% 47.22%, 100.00% 47.22%, 100.00% 50.00%, 100.00% 50.00%, 100.00% 52.78%, 100.00% 52.78%, 100.00% 55.56%, 100.00% 55.56%, 100.00% 58.33%, 100.00% 58.33%, 100.00% 61.11%, 100.00% 61.11%, 100.00% 63.89%, 100.00% 63.89%, 100.00% 66.67%, 97.22% 66.67%, 97.22% 69.44%, 97.22% 69.44%, 97.22% 72.22%, 94.44% 72.22%, 94.44% 75.00%, 94.44% 75.00%, 94.44% 77.78%, 91.67% 77.78%, 91.67% 80.56%, 88.89% 80.56%, 88.89% 83.33%, 86.11% 83.33%, 86.11% 86.11%, 83.33% 86.11%, 83.33% 88.89%, 80.56% 88.89%, 80.56% 91.67%, 77.78% 91.67%, 77.78% 94.44%, 72.22% 94.44%, 72.22% 97.22%, 63.89% 97.22%, 63.89% 100.00%, 36.11% 100.00%, 36.11% 97.22%, 27.78% 97.22%, 27.78% 94.44%, 22.22% 94.44%, 22.22% 91.67%, 19.44% 91.67%, 19.44% 88.89%, 16.67% 88.89%, 16.67% 86.11%, 13.89% 86.11%, 13.89% 83.33%, 11.11% 83.33%, 11.11% 80.56%, 8.33% 80.56%, 8.33% 77.78%, 5.56% 77.78%, 5.56% 75.00%, 5.56% 75.00%, 5.56% 72.22%, 2.78% 72.22%, 2.78% 69.44%, 2.78% 69.44%, 2.78% 66.67%, 0.00% 66.67%, 0.00% 63.89%, 0.00% 63.89%, 0.00% 61.11%, 0.00% 61.11%, 0.00% 58.33%, 0.00% 58.33%, 0.00% 55.56%, 0.00% 55.56%, 0.00% 52.78%, 0.00% 52.78%, 0.00% 50.00%, 0.00% 50.00%, 0.00% 47.22%, 0.00% 47.22%, 0.00% 44.44%, 0.00% 44.44%, 0.00% 41.67%, 0.00% 41.67%, 0.00% 38.89%, 0.00% 38.89%, 0.00% 36.11%, 0.00% 36.11%, 0.00% 33.33%, 2.78% 33.33%, 2.78% 30.56%, 2.78% 30.56%, 2.78% 27.78%, 5.56% 27.78%, 5.56% 25.00%, 5.56% 25.00%, 5.56% 22.22%, 8.33% 22.22%, 8.33% 19.44%, 11.11% 19.44%, 11.11% 16.67%, 13.89% 16.67%, 13.89% 13.89%, 16.67% 13.89%, 16.67% 11.11%, 19.44% 11.11%, 19.44% 8.33%, 22.22% 8.33%, 22.22% 5.56%, 27.78% 5.56%, 27.78% 2.78%, 36.11% 2.78%, 36.11% 0.00%);
  filter: drop-shadow(0 0 14px rgba(232, 196, 106, .25));
}
.tarot-photo-frame {
  position: absolute; inset: 0;
  background: var(--panel-2);
  clip-path: polygon(50.00% 0.00%, 50.00% 2.78%, 63.89% 2.78%, 63.89% 5.56%, 69.44% 5.56%, 69.44% 8.33%, 75.00% 8.33%, 75.00% 11.11%, 80.56% 11.11%, 80.56% 13.89%, 83.33% 13.89%, 83.33% 16.67%, 86.11% 16.67%, 86.11% 19.44%, 88.89% 19.44%, 88.89% 22.22%, 91.67% 22.22%, 91.67% 25.00%, 91.67% 25.00%, 91.67% 27.78%, 94.44% 27.78%, 94.44% 30.56%, 94.44% 30.56%, 94.44% 33.33%, 97.22% 33.33%, 97.22% 36.11%, 97.22% 36.11%, 97.22% 38.89%, 97.22% 38.89%, 97.22% 41.67%, 97.22% 41.67%, 97.22% 44.44%, 97.22% 44.44%, 97.22% 47.22%, 97.22% 47.22%, 97.22% 50.00%, 97.22% 50.00%, 97.22% 52.78%, 97.22% 52.78%, 97.22% 55.56%, 97.22% 55.56%, 97.22% 58.33%, 97.22% 58.33%, 97.22% 61.11%, 97.22% 61.11%, 97.22% 63.89%, 97.22% 63.89%, 97.22% 66.67%, 94.44% 66.67%, 94.44% 69.44%, 94.44% 69.44%, 94.44% 72.22%, 91.67% 72.22%, 91.67% 75.00%, 91.67% 75.00%, 91.67% 77.78%, 88.89% 77.78%, 88.89% 80.56%, 86.11% 80.56%, 86.11% 83.33%, 83.33% 83.33%, 83.33% 86.11%, 80.56% 86.11%, 80.56% 88.89%, 75.00% 88.89%, 75.00% 91.67%, 69.44% 91.67%, 69.44% 94.44%, 63.89% 94.44%, 63.89% 97.22%, 50.00% 97.22%, 50.00% 100.00%, 50.00% 100.00%, 50.00% 97.22%, 36.11% 97.22%, 36.11% 94.44%, 30.56% 94.44%, 30.56% 91.67%, 25.00% 91.67%, 25.00% 88.89%, 19.44% 88.89%, 19.44% 86.11%, 16.67% 86.11%, 16.67% 83.33%, 13.89% 83.33%, 13.89% 80.56%, 11.11% 80.56%, 11.11% 77.78%, 8.33% 77.78%, 8.33% 75.00%, 8.33% 75.00%, 8.33% 72.22%, 5.56% 72.22%, 5.56% 69.44%, 5.56% 69.44%, 5.56% 66.67%, 2.78% 66.67%, 2.78% 63.89%, 2.78% 63.89%, 2.78% 61.11%, 2.78% 61.11%, 2.78% 58.33%, 2.78% 55.56%, 2.78% 55.56%, 2.78% 52.78%, 2.78% 52.78%, 2.78% 50.00%, 2.78% 50.00%, 2.78% 47.22%, 2.78% 47.22%, 2.78% 44.44%, 2.78% 44.44%, 2.78% 41.67%, 2.78% 41.67%, 2.78% 38.89%, 2.78% 38.89%, 2.78% 36.11%, 2.78% 36.11%, 2.78% 33.33%, 5.56% 33.33%, 5.56% 30.56%, 5.56% 30.56%, 5.56% 27.78%, 8.33% 27.78%, 8.33% 25.00%, 8.33% 25.00%, 8.33% 22.22%, 11.11% 22.22%, 11.11% 19.44%, 13.89% 19.44%, 13.89% 16.67%, 16.67% 16.67%, 16.67% 13.89%, 19.44% 13.89%, 19.44% 11.11%, 25.00% 11.11%, 25.00% 8.33%, 30.56% 8.33%, 30.56% 5.56%, 36.11% 5.56%, 36.11% 2.78%, 50.00% 2.78%, 50.00% 0.00%);
}
.tarot-photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
  transition: transform .4s ease-out;
}
.tarot-scene:hover .tarot-photo-frame img { transform: scale(1.05); }

/* 流光 */
.tarot-glare {
  position: absolute; inset: 0;
  background: radial-gradient(circle 130px at var(--gx, 50%) var(--gy, 50%),
              rgba(255, 248, 220, .28), transparent 70%);
  mix-blend-mode: screen;
  opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.tarot-scene:hover .tarot-glare { opacity: 1; }

/* 牌面内外链按钮（GitHub / Scholar）：金色描边，与牌框同风格 */
.tarot-links {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.tarot-links a {
  font-family: var(--font-pixel);
  font-size: 8px; letter-spacing: 1px;
  color: var(--gold); text-decoration: none;
  border: 1px solid var(--gold-dim);
  padding: 7px 10px;
  background: rgba(232, 196, 106, .06);
  transition: all .12s;
  display: inline-flex; align-items: center;
}
/* 链接前的官方 logo（内联 SVG）：currentColor 上色，悬停随文字一起反色 */
.lico { width: 10px; height: 10px; margin-right: 6px; flex: none; }
.tarot-links a:hover {
  background: var(--gold); border-color: var(--gold);
  color: var(--bg0);
  box-shadow: 0 0 12px rgba(232, 196, 106, .45);
}
.tarot-deco {
  margin-top: 10px;
  display: flex; align-items: center; gap: 10px;
  color: var(--gold); font-size: 13px; opacity: .8;
}
.tarot-deco .diamond { width: 5px; height: 5px; background: var(--gold-dim); transform: rotate(45deg); }

/* 牌背 */
.tarot-back .tarot-border-inner { justify-content: center; gap: 22px; }
.tarot-back-sigil {
  font-size: 64px; color: var(--gold);
  text-shadow: 0 0 30px rgba(232, 196, 106, .55);
  animation: sigilSpin 14s linear infinite;
}
@keyframes sigilSpin { to { transform: rotate(360deg); } }
.tarot-back-quote { color: var(--dim); text-align: center; font-size: 20px; padding: 0 8px; }

/* 牌下阴影 */
.tarot-shadow {
  width: 60%; height: 14px;
  margin: 26px auto 0;
  background: rgba(0, 0, 0, .5);
  filter: blur(8px);
  border-radius: 50%;
  animation: shadowPulse 5.5s ease-in-out infinite alternate;
}
@keyframes shadowPulse { from { transform: scaleX(.92); opacity: .8; } to { transform: scaleX(1.05); opacity: .5; } }

/* ---------- 面板 ---------- */
.panel {
  position: relative;
  background: rgba(18, 19, 38, .86);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(243, 233, 200, .05),
    6px 6px 0 rgba(0, 0, 0, .22);
  padding: 34px 38px 36px;
  scroll-margin-top: 92px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.section-title {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-pixel);
  font-size: 12px; letter-spacing: 0;
  color: var(--cream);
  text-shadow: 0 0 16px rgba(243, 233, 200, .22);
  margin-bottom: 20px;
}
.section-title .glyph { color: var(--gold); font-size: 11px; }
.section-title .rule { flex: 1; border-bottom: 2px dashed var(--line); }
.note { color: var(--dim); font-size: 14px; margin-bottom: 16px; }
/* 合并板块内的子标题（WORK / EDUCATION） */
.sub-title {
  font-family: var(--font-pixel);
  font-size: 9px; letter-spacing: 0;
  color: var(--cyan);
  margin: 22px 0 12px;
}
.sub-title:first-of-type { margin-top: 0; }
#bio p { margin-bottom: 12px; }
#bio p:last-child { margin-bottom: 0; }

/* ---------- 实习经历 ---------- */
.exp-item { position: relative; padding-left: 26px; margin-bottom: 18px; }
.exp-item:last-child { margin-bottom: 0; }
.exp-item::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 8px; height: 8px; background: var(--gold);
  box-shadow: 0 0 10px rgba(232, 196, 106, .6);
}
.exp-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.exp-role { color: var(--cream); font-size: 17px; font-weight: 700; }
.exp-org  { color: var(--cyan); }
.exp-period {
  font-family: var(--font-pixel); font-size: 8px; letter-spacing: 0;
  color: var(--dim);
}
.exp-desc { color: var(--text); font-size: 14px; margin-top: 7px; }

/* ---------- 论文卡片 ---------- */
.pub-card {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--gold-dim);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: border-color .15s, transform .15s;
}
.pub-card:hover { border-color: var(--gold-dim); border-left-color: var(--gold); transform: translateX(3px); }
.pub-title {
  font-family: var(--font-body);
  font-size: 17px; line-height: 1.4; font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
}
.pub-authors { color: var(--text); font-size: 13px; line-height: 1.55; margin-bottom: 4px; }
.pub-authors strong { color: var(--cream); }
.pub-venue { color: var(--cyan); font-size: 14px; font-weight: 600; }
.pub-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

.badge {
  font-family: var(--font-pixel);
  font-size: 7px; letter-spacing: 0;
  padding: 6px 8px;
  color: var(--bg0);
}
.badge.ccf-a   { background: #e85a5a; box-shadow: 0 3px 0 #7e2f2f; }
.badge.ccf-b   { background: #e8c46a; box-shadow: 0 3px 0 #8a6d2f; }
.badge.ccf-c   { background: #6ec6d8; box-shadow: 0 3px 0 #2f6f7e; }
.badge.cas     { background: #d98fb8; box-shadow: 0 3px 0 #7e3f68; }
.badge.default { background: #7fd8a4; box-shadow: 0 3px 0 #3f7e58; }
/* 发表状态 */
.badge.status {
  display: inline-flex; align-items: center;
  background: rgba(127, 216, 164, .10);
  color: #7fd8a4; border: 1px solid #7fd8a4;
  box-shadow: none;
}
.badge.status::before {
  content: ""; width: 5px; height: 5px;
  background: #7fd8a4; margin-right: 6px;
}
@keyframes accPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(127, 216, 164, .25); }
  50%      { box-shadow: 0 0 16px rgba(127, 216, 164, .6); }
}
@keyframes accBlink { 50% { opacity: .25; } }
.badge.status.review {
  background: transparent; box-shadow: none; animation: none;
  color: #b48fe8; border-color: #b48fe8;
}
.badge.status.review::before { display: none; }
/* 审稿均分（Under Review 会议论文的 Meta score，紫色微光） */
.badge.meta {
  background: rgba(180, 143, 232, .12);
  color: #cfb2f5; border: 1px solid #b48fe8;
  box-shadow: 0 0 10px rgba(180, 143, 232, .35);
}
/* 补充评级标签：金色空心，如 CORE A* / TH-CPL A */
.badge.alt { background: transparent; box-shadow: none; color: var(--gold); border: 1px solid var(--gold); }
/* 可点击的评级徽章 */
a.badge { text-decoration: none; transition: transform .12s, filter .12s; }
a.badge:hover { transform: translateY(-2px); filter: brightness(1.15); }
.pub-note { font-size: 11px; color: var(--dim); margin: 0 0 7px; }
.pub-authors .eq { color: var(--pink); }

/* 论文关键词（作者名单下方） */
.pub-keywords { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.pub-keywords .kw {
  font-size: 11px; letter-spacing: 0;
  color: var(--dim);
  border: 1px solid rgba(139, 141, 176, .35);
  padding: 4px 7px;
  transition: color .12s, border-color .12s;
}
.pub-keywords .kw:hover { color: var(--cyan); border-color: rgba(143, 216, 232, .5); }

.pub-links { display: inline-flex; gap: 8px; }
.pub-links a {
  font-size: 12px; font-weight: 700; letter-spacing: 0;
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid rgba(143, 216, 232, .4);
  padding: 5px 8px;
  transition: all .12s;
}
.pub-links a:hover { background: var(--cyan); color: var(--bg0); }

/* ---------- 教育 / 奖项 ---------- */
.edu-list, .award-list { list-style: none; }
.edu-list li, .award-list li { margin: 10px 0; padding-left: 24px; position: relative; }
.edu-list li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; background: var(--cyan); opacity: .8;
}
.award-list li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; background: var(--gold);
  transform: rotate(45deg);
}
.edu-period { color: var(--dim); margin-right: 10px; }

/* ---------- 爱好 ---------- */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.hobby-card {
  background: var(--panel-2);
  border: 2px solid var(--line-soft);
  padding: 18px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.hobby-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold-dim);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.hobby-card:hover .hobby-icon { animation: bob .5s steps(2) infinite; }
.hobby-icon { font-size: 28px; display: inline-block; margin-bottom: 10px; }
.hobby-icon img { width: 36px; height: 36px; image-rendering: pixelated; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.hobby-title {
  font-family: var(--font-pixel);
  font-size: 10px; letter-spacing: 2px;
  color: var(--cream);
  margin-bottom: 8px;
}
.hobby-desc { color: var(--text); font-size: 14px; }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--dim); font-size: 13px; margin-top: 8px; }
.footer-divider { color: var(--gold); font-size: 13px; letter-spacing: 6px; margin-bottom: 14px; opacity: .8; }

/* ---------- 滚动显现 ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 手机端 ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .navbar { font-size: 7px; padding: 12px 14px; }
  .nav-links { gap: 10px; }
  .hero { flex-direction: column; align-items: stretch; gap: 28px; padding-top: 34px; }
  .tarot-scene { align-self: center; }
  .hero-info { min-width: 0; width: 100%; flex-basis: auto; }
  .pixel-title { font-size: 20px; line-height: 1.5; }
  .hero-summary { font-size: 15px; }
  .stat-list .k { min-width: 76px; }
  .panel { padding: 22px 18px; }
  .pub-card { padding: 18px 16px; }
  .pub-title { font-size: 16px; }
  .moon-wrap {
    top: 3px; left: 48px; right: auto; z-index: 41;
    transform: scale(.24); transform-origin: top left;
    animation: none;
  }
  /* 触屏没有悬停，塔罗牌保持可见即可 */
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   Day theme: the same lunar palette in daylight.
   ============================================================ */

/* ---------- 白天配色：覆写变量 ---------- */
html.day {
  --bg0:      #eceef1;
  --bg1:      #f6f6f3;
  --panel:    rgba(255, 255, 255, .9);
  --panel-2:  #f8f8f7;
  --line:     #cbd1d6;
  --line-soft:#dde1e4;
  --cream:    #252c36;
  --gold:     #ad8132;
  --gold-dim: rgba(173, 129, 50, .5);
  --cyan:     #286e78;
  --text:     #394451;
  --dim:      #58636d;
  --pink:     #825c70;
}

html.day #starfield {
  background:
    radial-gradient(ellipse 90% 22% at 85% 82%, rgba(74, 85, 88, .065), transparent 78%),
    linear-gradient(to bottom, #eef0ef 0%, #f7f7f4 68%, #e9edeb 100%);
}
html.day .star, html.day .shooting { display: none; }

html.day .cloud { --cl: rgba(75, 85, 87, .045); }
html.day .ink-geese { display: block; }
html.day .mountains-back {
  height: 260px;
  background: linear-gradient(to bottom, rgba(80, 93, 93, .18), rgba(80, 93, 93, .035));
  opacity: 1;
  clip-path: polygon(0 100%, 0 78%, 7% 71%, 12% 73%, 20% 49%, 24% 44%, 28% 54%, 36% 75%, 43% 59%, 49% 63%, 56% 31%, 59% 28%, 64% 48%, 70% 69%, 79% 52%, 84% 56%, 90% 36%, 94% 46%, 100% 65%, 100% 100%);
  filter: blur(2px);
}
html.day .mountains-front {
  height: 145px;
  background: linear-gradient(to bottom, rgba(62, 77, 78, .17), rgba(62, 77, 78, .04));
  opacity: 1;
  clip-path: polygon(0 100%, 0 70%, 8% 77%, 16% 45%, 20% 41%, 26% 60%, 32% 67%, 39% 38%, 44% 51%, 49% 76%, 57% 59%, 64% 64%, 72% 33%, 77% 46%, 85% 70%, 93% 54%, 100% 67%, 100% 100%);
  filter: blur(1px);
}
html.day .grain { opacity: .07; }

html.day .navbar { background: rgba(248, 249, 248, .86); border-color: var(--line); }
html.day .panel {
  background: var(--panel);
  border-color: #c7c2b7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 6px 6px 0 rgba(112, 76, 48, .07);
}
html.day .section-title { color: #3b3430; text-shadow: none; }
html.day .section-title .glyph { color: #9f3f35; }
html.day .section-title .rule { border-color: rgba(159, 63, 53, .3); }
html.day .nav-links a.active { color: #9f3f35; text-shadow: none; }
html.day .nav-links a.active::before { color: #9f3f35; }
html.day .hero-action-primary { color: #1e252c; }
html.day .hero-action-primary {
  position: relative;
  background: linear-gradient(135deg, #f4f0e5 0%, #e9e0cb 100%);
  border-color: #b69b64;
  box-shadow: 4px 4px 0 rgba(112, 76, 48, .16), inset 0 1px 0 rgba(255, 255, 255, .85);
  color: #5c4030;
}
html.day .hero-action-primary::before { display: none; }
html.day .hero-action-primary:hover { background: #e9dfc6; border-color: #9f3f35; box-shadow: 4px 4px 0 rgba(112, 76, 48, .18); }
html.day .hero-action-secondary { background: rgba(255, 255, 255, .88); }
html.day .cat .cpx.c { background: #c1a66f; }
/* Daylight ink palette for pixel cats: warm ink replaces the night-only purple outline. */
html.day .cat .cpx.o { background: #4b4038; }
html.day .cat .cpx.c { background: #f3eee2; }
html.day .cat .cpx.p { background: #a44b42; }
html.day .cat .cpx.s { background: #b89b65; }
html.day .cat .cpx.g { background: #718383; }

/* ---------- 白天论文徽章：浅底可读版（夜间配色是为深底设计的） ---------- */
html.day .badge { color: #fff; }
html.day .badge.ccf-a   { background: #a8575a; box-shadow: none; }
html.day .badge.ccf-b   { background: #775719; box-shadow: none; }
html.day .badge.ccf-c   { background: #427e86; box-shadow: none; }
html.day .badge.cas     { background: #846878; box-shadow: none; }
html.day .badge.default { background: #4e7962; box-shadow: none; }
html.day .badge.alt { color: #775719; }
html.day .badge.status {
  background: #e8f0e9;
  color: #326348; border: 1px solid #83a894;
  box-shadow: none;
  animation: none;
}
html.day .badge.status::before { background: #326348; }
html.day .badge.status.review { color: #70566e; border-color: #bca9ba; background: #f4eef3; }
html.day .badge.meta {
  background: #f4eef3;
  color: #70566e; border: 1px solid #bca9ba;
  box-shadow: none;
}
html.day .pub-links a { border-color: rgba(40, 110, 120, .4); }

html.day .pub-keywords .kw {
  color: var(--dim);
  border: 1px solid var(--line);
  background: #f5f7f7;
}
html.day .pub-keywords .kw:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
html.day .chip {
  color: var(--cyan);
  border: 1px solid #a6c4c7;
  background: rgba(255, 255, 255, .72);
}

html.day .tarot-face {
  background: #f8f9f8;
  box-shadow:
    0 0 0 1px rgba(46, 58, 70, .16),
    0 0 36px rgba(173, 129, 50, .1),
    14px 18px 0 rgba(46, 58, 70, .1);
}
html.day .tarot-scene:hover .tarot-face {
  box-shadow:
    0 0 0 1px rgba(46, 58, 70, .18),
    0 0 44px rgba(173, 129, 50, .16),
    18px 24px 0 rgba(46, 58, 70, .1);
}
html.day .pub-card, html.day .hobby-card { background: #fbfcfb; }
html.day .tarot-photo-frame { background: #eef0f0; }
html.day .tarot-links a { background: rgba(173, 129, 50, .05); }

/* ---------- 太阳：替换月亮（与月亮同一容器，复用浮动动画） ---------- */
#sun { display: none; }
#sun .row { display: flex; }
#sun .px { width: 4px; height: 4px; }
#sun .y { background: #f4d79a; }
#sun .g { background: #c65d45; }
#sun .a { background: #9f3f35; }
#sun .t { background: transparent; }
html.day #moon { display: none; }
html.day #sun { display: grid; grid-auto-rows: 4px; }
html.day .moon-wrap { filter: drop-shadow(0 0 24px rgba(178, 77, 55, .2)); }

/* 水墨雁阵：多层次队形、轻微升降和墨迹拖影，作为白天远景 */
.ink-geese { display: none; position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ink-geese i {
  position: absolute; left: -100px; width: 34px; height: 14px;
  border-top: 2px solid rgba(50, 62, 62, .34);
  border-radius: 50% 50% 0 0;
  transform: rotate(-7deg) scaleX(.9);
  filter: drop-shadow(-8px 3px 0 rgba(50, 62, 62, .055));
  animation: geeseFlight 30s linear infinite;
}
.ink-geese i::before, .ink-geese i::after {
  content: ""; position: absolute; top: -7px; width: 17px; height: 9px;
  border-top: 2px solid rgba(50, 62, 62, .34); border-radius: 50%;
}
.ink-geese i::before { left: 0; transform: rotate(21deg); }
.ink-geese i::after { right: 0; transform: rotate(-21deg); }
.ink-geese i:nth-child(1) { top: 18%; animation-delay: -6s; opacity: .72; }
.ink-geese i:nth-child(2) { top: 23%; transform: scale(.72) rotate(-7deg); animation-delay: -16s; opacity: .48; }
.ink-geese i:nth-child(3) { top: 27%; transform: scale(.55) rotate(-7deg); animation-delay: -24s; opacity: .4; }
.ink-geese i:nth-child(4) { top: 20%; transform: scale(.42) rotate(-7deg); animation-delay: -12s; opacity: .28; }
.ink-geese i:nth-child(5) { top: 31%; transform: scale(.34) rotate(-7deg); animation-delay: -27s; opacity: .23; }
.ink-geese i:nth-child(6) { top: 16%; transform: scale(.28) rotate(-7deg); animation-delay: -20s; opacity: .2; }
@keyframes geeseFlight {
  0% { left: -100px; opacity: 0; }
  8% { opacity: inherit; }
  42% { transform: translateY(-15px) rotate(-5deg) scaleX(.9); }
  68% { transform: translateY(10px) rotate(-9deg) scaleX(.9); }
  92% { opacity: inherit; }
  100% { left: calc(100% + 100px); opacity: 0; transform: translateY(-4px) rotate(-7deg) scaleX(.9); }
}

/* ---------- 主题切换提示：月亮/太阳右侧的像素箭头 + 目标主题图标，周期性闪现 ---------- */
.theme-hint {
  position: absolute; left: calc(100% + 14px); top: 50%;
  display: flex; align-items: center; gap: 9px;
  transform: translateY(-50%);
  font-family: var(--font-pixel); font-size: 10px;
  color: var(--gold);
  text-shadow: 0 0 8px var(--gold-dim);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: hintBlink 6s ease-in-out infinite;
}
.theme-hint::before {   /* 像素箭头（box-shadow 逐像素拼），指向月亮/太阳 */
  content: "";
  width: 4px; height: 4px;
  background: var(--gold);
  box-shadow:
    8px -8px 0 var(--gold),
    4px -4px 0 var(--gold), 8px -4px 0 var(--gold),
    0 0 0 var(--gold), 4px 0 0 var(--gold), 8px 0 0 var(--gold), 12px 0 0 var(--gold),
    4px 4px 0 var(--gold), 8px 4px 0 var(--gold),
    8px 8px 0 var(--gold);
}
@keyframes hintBlink {
  0%, 100% { opacity: .38; transform: translateY(-50%) translateX(3px); }
  50%      { opacity: 1;   transform: translateY(-50%) translateX(0); }
}
@media (max-width: 720px) {
  .theme-hint { display: none; }   /* 窄屏右侧空间不足，避免溢出 */
}

/* ---------- 主题切换过场：二进制列由下向上扫过画面 ---------- */
.theme-wipe {
  position: fixed; inset: 0; z-index: 200;
  width: 100vw; height: 100vh;
  margin: 0; padding: 0; border: 0; background: transparent;
  overflow: hidden;
  pointer-events: none;
}
.theme-wipe .bcol {
  position: absolute; top: 0;
  font-family: var(--font-pixel); font-size: 10px; line-height: 2.2;
  white-space: pre; text-align: center;
  color: var(--code-color);
  opacity: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .08) 16%, #000 34%, #000 66%, rgba(0, 0, 0, .08) 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .08) 16%, #000 34%, #000 66%, rgba(0, 0, 0, .08) 84%, transparent 100%);
  animation: binFloat var(--wt, 1.2s) linear var(--wd, 0s) both;
}
@keyframes binFloat {
  0%   { transform: translateY(112vh); opacity: 0; }
  14%  { opacity: .12; }
  28%  { opacity: .4; }
  70%  { opacity: .28; }
  100% { transform: translateY(-122%); opacity: 0; }
}
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .75s;
  animation-timing-function: ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .01s; }
}

/* ---------- 马里奥奔跑场景（仅白天显示） ---------- */
#mario-scene { display: none; }
html.day #mario-scene {
  display: block;
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
}

/* 砖块地面（顶部加一层草地，SMB 风味） */
.mario-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 28px;
  background:
    repeating-linear-gradient(90deg, #3f8f46 0 4px, transparent 4px 11px) top / 100% 6px no-repeat,
    linear-gradient(#5cb853, #4da354) top / 100% 6px no-repeat,
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .28) 0 2px, transparent 2px 14px),
    linear-gradient(#e08030, #c85f10);
  border-top: 4px solid #7b3f00;
}

/* 场景装饰（水管/砖块/山/草丛/像素云，JS 逐像素生成） */
.deco { position: absolute; bottom: 28px; z-index: 1; }
.deco .drow, .pcloud .drow, #shroom .drow { display: flex; }
#pipe1 { left: 24%; }
#pipe2 { left: 72%; }
#hill1 { left: 6%; }
#bush1 { left: 38%; }
#bush2 { left: 86%; }
.deco-brick { bottom: 118px; }          /* 与问号砖同一高度，left 由 JS 按 blockX 贴齐 */
.pcloud {
  position: absolute; z-index: 0;
  animation: cloudDrift 90s linear infinite;
}
#pc1 { top: 13%; animation-duration: 80s; }
#pc2 { top: 27%; animation-duration: 115s; animation-delay: -45s; }
#pc3 { top: 6%;  animation-duration: 95s;  animation-delay: -70s; }
@keyframes cloudDrift {
  from { left: -14%; }
  to   { left: 104%; }
}

/* 马里奥精灵（JS 生成色块与位移；可点击，点了会原地跳一下） */
#mario { position: absolute; bottom: 28px; left: -60px; width: 48px; height: 48px; z-index: 2; pointer-events: auto; cursor: pointer; transform-origin: bottom left; transition: scale .25s ease; }

/* 蘑菇（中间问号砖撞出，落地向右滑，马里奥捡到变大；JS 生成精灵与移动） */
#shroom { position: absolute; bottom: 28px; z-index: 1; display: none; }
#shroom.show { display: block; }

/* 求助气泡：马里奥被水管挡住时出现（与马里奥一起临时提升到内容层之上，保证可见可点） */
#marioBubble {
  position: absolute; bottom: 92px; z-index: 61;
  transform: translateX(-50%);
  padding: 6px 8px;
  font-family: var(--font-pixel); font-size: 8px; letter-spacing: 1px;
  color: #241a12; background: #ffffff;
  border: 3px solid #241a12;
  white-space: nowrap;
  display: none;
  animation: bubbleBob .6s ease-in-out infinite alternate;
}
#marioBubble.show { display: block; }
#marioBubble::after {   /* 像素小尾巴 */
  content: ""; position: absolute; left: 50%; bottom: -9px;
  width: 6px; height: 6px; margin-left: -3px;
  background: #ffffff;
  border-right: 3px solid #241a12; border-bottom: 3px solid #241a12;
}
@keyframes bubbleBob {
  from { margin-bottom: 0; }
  to   { margin-bottom: 6px; }
}

/* 金币计数器（左下角，点问号砖帮马里奥赚金币） */
#coinCount {
  position: absolute; left: 14px; bottom: 40px; z-index: 3;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-pixel); font-size: 10px; color: #5c2e00;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .6);
}
#coinCount .ccoin {
  width: 14px; height: 14px; border-radius: 50%;
  background: #ffd94d; border: 3px solid #b8860b;
}
#mario .mframe { position: absolute; bottom: 0; left: 0; }
#mario .mrow { display: flex; }
#mario .mpx { width: 3px; height: 3px; }
#mario .R { background: #e52521; }   /* 帽子与上衣 */
#mario .S { background: #ffcf9c; }   /* 皮肤 */
#mario .B { background: #2b5de4; }   /* 背带裤 */
#mario .W { background: #7b3f00; }   /* 头发与鞋 */
#mario .o { background: #241a12; }   /* 眼睛 */
#mario .t { background: transparent; }

/* 问号砖块（共三块，点击顶出金币；位置由 JS 按屏宽布置） */
.qblk {
  position: absolute; bottom: 118px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: #f8a818;
  border: 4px solid #5c2e00;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, .25);
  font-family: var(--font-pixel); font-size: 16px; color: #5c2e00;
}
.qblk.used { background: #b08040; color: transparent; box-shadow: inset -4px -4px 0 rgba(0, 0, 0, .3); }
.qblk.bump { animation: qBump .3s ease-out; }
@keyframes qBump {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* 金币（从被点击的砖块里弹出） */
.bcoin {
  position: absolute; bottom: 100%; left: 50%;
  width: 26px; height: 26px; margin-left: -13px;
  border-radius: 50%;
  background: #ffd94d;
  border: 4px solid #b8860b;
  opacity: 0;
}
.bcoin.pop { animation: coinPop .8s ease-out forwards; }
@keyframes coinPop {
  0%   { opacity: 1; transform: translateY(0) scaleX(1); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-72px) scaleX(.2); }
}

/* 小屏与减少动态偏好下不显示马里奥场景 */
@media (max-width: 640px) {
  html.day #mario-scene { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.day #mario-scene { display: none; }
}

/* ===== Pixel observatory: one grid, one accent, quiet hierarchy ===== */
:root {
  --bg0: #0c0e10; --bg1: #15191b; --panel: rgba(18,22,24,.93);
  --panel-2: #191e20; --line: #41494a; --line-soft: #303738;
  --cream: #e4e8e3; --gold: #b7c6b9; --gold-dim: #7b9084;
  --cyan: #a3bbb5; --text: #c7ceca; --dim: #9ca9a4; --pink: #b3a6af;
}
html.day {
  --bg0: #f0f1ed; --bg1: #f7f8f4; --panel: rgba(247,248,244,.94);
  --panel-2: #ecefe9; --line: #c3cbc3; --line-soft: #d5dbd3;
  --cream: #27312e; --gold: #435e50; --gold-dim: #8d9e91;
  --cyan: #4b6960; --text: #414f49; --dim: #63726a; --pink: #746874;
}
.hero { display: grid; grid-template-columns: 252px minmax(0,1fr); gap: 64px; align-items: center; padding: 76px 8px 66px; }
.portrait-column { width: 252px; align-self: center; }
.tarot-scene { width: 252px; animation: none; perspective: 1300px; }
.tarot-card { width: 252px; height: 252px; }
.tarot-scene .tarot-face, .tarot-scene:hover .tarot-face,
html.day .tarot-scene .tarot-face, html.day .tarot-scene:hover .tarot-face {
  background: transparent; border: 0; box-shadow: none;
}
.tarot-face::before, .tarot-top, .tarot-deco, .tarot-shadow, #catSleep { display: none; }
.tarot-scene .tarot-border-inner { inset: 0; border: 0; padding: 0; }
.tarot-scene .tarot-photo-ring { width: 252px; height: 252px; margin: 0; background: none; clip-path: none; filter: none; }
.tarot-scene .tarot-photo-frame { clip-path: none; overflow: hidden; background: transparent; }
.tarot-photo-frame img { image-rendering: auto; filter: saturate(.7); }
.tarot-glare { display: none; }
.tarot-scene .tarot-back, html.day .tarot-scene .tarot-back { background: transparent; }
.tarot-back-quote { line-height: 1.7; font-size: 18px; }
.tarot-scene:focus-visible { outline: 1px solid var(--cyan); outline-offset: 6px; }
.portrait-links { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px 12px; margin-top:18px; position:relative; }
.portrait-links a { display: inline-flex; align-items: center; min-height: 32px; color: var(--dim); text-decoration: none; font: 11px/1.5 var(--font-body); white-space: nowrap; border-bottom: 1px solid transparent; transition: color .2s,border-color .2s; }
.portrait-links a:hover, .portrait-links a:focus-visible { color: var(--cream); border-bottom-color: var(--gold); }
.portrait-links .lico { width: 12px; height: 12px; margin-right: 5px; }
.hero-info { min-width: 0; }
.hero-hello { font: 10px/1.6 monospace; letter-spacing: .17em; color: var(--dim); margin-bottom: 6px; opacity: 1; }
.identity-wordmark { position: relative; width: 100%; height: 98px; margin-bottom: 6px; }
.identity-wordmark h1 { display: flex; align-items: center; height: 100%; font-size: clamp(22px, 3vw, 34px); text-shadow: none; white-space: nowrap; margin: 0; }
.identity-wordmark.ready h1 { opacity: 0; }
#signalCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; pointer-events: auto; }
.tagline { font-size: 15px; font-weight: 400; color: var(--dim); letter-spacing: .015em; margin-bottom: 22px; }
.stat-list { border-top: 1px solid var(--line); padding-top: 17px; }
.stat-list li { line-height: 1.8; }
.chip-row { gap: 7px; }
.chip, html.day .chip { background: transparent; border-color: var(--line-soft); color: var(--cyan); font-size: 11px; padding: 5px 8px; }
.hero-actions { gap: 18px; align-items: center; margin-top: 23px; }
.hero-actions a { font-size: 12px; font-weight: 500; padding: 11px 13px; border-radius: 0; }
.hero-actions .hero-action-primary, html.day .hero-actions .hero-action-primary { background: var(--cream); color: var(--bg0); border: 1px solid var(--cream); box-shadow: none; }
.hero-actions .hero-action-secondary, html.day .hero-actions .hero-action-secondary { background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; box-shadow: none; }
.hero-actions a:hover { transform: none; filter: brightness(.93); }
.panel, html.day .panel { background: var(--panel); border: 0; border-top: 1px solid var(--line); box-shadow: none; padding: 36px 30px 38px; }
.section-title, html.day .section-title { font: 11px/1.7 var(--font-pixel); color: var(--cream); text-shadow: none; gap: 14px; margin-bottom: 25px; }
.section-title .glyph, html.day .section-title .glyph { color: var(--gold); font-size: 9px; }
.section-title .rule, html.day .section-title .rule { border: 0; height: 5px; background: repeating-linear-gradient(90deg,var(--line) 0 2px,transparent 2px 6px); opacity: .55; }
.sub-title { color: var(--dim); font-size: 8px; }
.exp-item::before { width: 5px; height: 5px; box-shadow: none; }
.exp-period { font: 10px/1.6 monospace; letter-spacing: .03em; }
.pub-card, html.day .pub-card { background: transparent; border: 0; border-bottom: 1px solid var(--line-soft); padding: 22px 0; margin: 0; }
.pub-card:hover { transform: none; border-color: var(--gold-dim); }
.pub-title { font-size: 18px; font-weight: 600; line-height: 1.55; }
.pub-links a { border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.hobby-card, html.day .hobby-card { background: transparent; box-shadow: none; border-color: var(--line-soft); }
.hobby-card:hover { box-shadow: none; transform: translateY(-2px); }
.cat { filter: grayscale(.8); opacity: .65; transition: opacity .2s,filter .2s; }
.cat:hover { filter: grayscale(.2); opacity: 1; }
.dust { display: none; }
.nav-logo, .nav-links a.active, html.day .nav-links a.active { color: var(--gold); text-shadow: none; }
.nav-links a.active::before, html.day .nav-links a.active::before { color: var(--gold); }
#starfield { background: radial-gradient(ellipse at 75% 20%,#1c2429 0%,#0c0e10 65%); }
.star { opacity: .45; }
.moon-wrap { filter: grayscale(.8); }
html.day .moon-wrap { filter: grayscale(.8); }
.theme-wipe { pointer-events: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .55s; animation-timing-function: cubic-bezier(.22,.61,.36,1); }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; justify-items: center; gap: 34px; padding: 40px 0 44px; }
  .hero-info { width: 100%; }
  .identity-wordmark { height: 80px; }
  .identity-wordmark h1 { font-size: clamp(21px,5vw,30px); }
  .hero-hello { font-size: 9px; }
  .panel, html.day .panel { padding: 28px 18px 30px; }
  .tagline { font-size: 13px; line-height: 1.8; min-height: 3.6em; }
  .hero-actions { gap: 16px; }
  .section-title, html.day .section-title { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .tarot-tilt, .tarot-card, .tarot-photo-frame img { transition: none !important; }
  .tarot-tilt { transform: none !important; }
  .star, .dust, .cat, .moon-wrap { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .01s; }
}
/* The arriving theme is revealed by the same wave that carries the glyphs. */
html.pixel-transition-active::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
html.pixel-transition-active::view-transition-new(root) {
  animation: holdThemeFrame 1.24s linear both;
  clip-path: var(--theme-mask, inset(100% 0 0));
  mix-blend-mode: normal;
}
@keyframes holdThemeFrame { from { opacity: 1; } to { opacity: 1; } }

/* Warm starlight + lagoon blue: color belongs to the hierarchy. */
:root {
  --bg0: #111326; --bg1: #191d35; --panel: rgba(24,29,49,.94); --panel-2: #202840;
  --line: #414d68; --line-soft: #34415a; --cream: #fff0d0;
  --gold: #edc47c; --gold-dim: #b69665; --cyan: #83cec9;
  --text: #d5ddee; --dim: #a5b4cb; --pink: #e4a1bc;
}
html.day {
  --bg0: #f4f6f1; --bg1: #fbfaf4; --panel: rgba(255,253,247,.94); --panel-2: #edf3ef;
  --line: #c3d0cb; --line-soft: #d8e0d6; --cream: #273c40;
  --gold: #a76a27; --gold-dim: #c29c66; --cyan: #257c83;
  --text: #3f5357; --dim: #627779; --pink: #ad5b7d;
}
#starfield { background: radial-gradient(ellipse at 80% 16%,#243753 0%,#191c36 42%,#101324 80%); }
html.day #starfield { background: radial-gradient(ellipse at 8% 5%,#dcefeb80,transparent 50%),radial-gradient(ellipse at 90% 40%,#f5dfc040,transparent 55%),linear-gradient(#f0f6f2,#fbfaf4 65%,#edf3ee); }
.moon-wrap, html.day .moon-wrap { filter: none; }
.nav-logo { color: var(--gold); }
.hero-hello { color: var(--cyan); }
.hero-actions .hero-action-primary, html.day .hero-actions .hero-action-primary { background: #ebbf77; border-color: #ebbf77; color: #313129; }
.hero-actions .hero-action-primary:hover { background: #f2cb8f; border-color: #f2cb8f; }
.section-title .glyph, html.day .section-title .glyph { color: var(--gold); }
.section-title .rule, html.day .section-title .rule { background: repeating-linear-gradient(90deg,var(--cyan) 0 2px,transparent 2px 6px); opacity: .3; }
.exp-item::before { background: var(--cyan); }
.pub-title { color: var(--cream); }
.pub-venue { color: var(--cyan); }
.pub-badges { gap: 7px; align-items: center; }
.badge, html.day .badge { font: 600 10px/1.3 var(--font-body); letter-spacing: .015em; padding: 5px 8px; border-radius: 4px; border: 1px solid transparent; box-shadow: none; }
.badge.ccf-a, html.day .badge.ccf-a { color: #f2b5a7; background: #da7c6120; border-color: #d895724d; }
.badge.ccf-b, html.day .badge.ccf-b { color: #edc781; background: #d4a75120; border-color: #d4a7514d; }
.badge.ccf-c, html.day .badge.ccf-c { color: #96cfe9; background: #68a8ce20; border-color: #68a8ce4d; }
.badge.cas, html.day .badge.cas { color: #d3b7e9; background: #b58ad120; border-color: #b58ad14d; }
.badge.alt, html.day .badge.alt { color: #a7cce7; background: #8aafd31a; border-color: #8aafd34d; }
.badge.default, .badge.status, html.day .badge.status { color: #9bd7bc; background: #6db68f1a; border-color: #6db68f4d; }
.badge.status::before, html.day .badge.status::before { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.badge.status.review, html.day .badge.status.review { color: #c6b6e2; background: #b29ad21a; border-color: #b29ad24d; }
html.day .badge.ccf-a { color: #9a473b; background: #fae9e0; border-color: #e9c6b8; }
html.day .badge.ccf-b { color: #89601f; background: #fbf0d5; border-color: #e5d0a1; }
html.day .badge.ccf-c, html.day .badge.alt { color: #3c6d8b; background: #e8f1f7; border-color: #bfd4e0; }
html.day .badge.cas { color: #775192; background: #f1eaf7; border-color: #d8c5e5; }
html.day .badge.status { color: #367253; background: #e8f3ea; border-color: #c2ddca; }
html.day .badge.status.review { color: #77608f; background: #f1edf7; border-color: #d7cbe6; }
.pub-links { gap: 8px; flex-wrap: wrap; }
.pub-links a, html.day .pub-links a { font-weight: 500; font-size: 11px; color: var(--cyan); padding: 5px 2px; border: 0; border-bottom: 1px solid var(--line); }
.pub-keywords .kw, html.day .pub-keywords .kw { border: 0; border-radius: 3px; color: var(--dim); background: #87bcb714; padding: 4px 7px; }
.pub-keywords .kw:hover { color: var(--cyan); background: #87bcb72a; }
/* One simple cat silhouette, with a different resting activity per section. */
.cat.companion { position: absolute; z-index: 6; display: block; width: 70px; height: 70px; top: -61px; right: 25px; pointer-events: auto; opacity: 1; filter: none; transform: none; cursor: pointer;
  --cat-fur:#30394b; --cat-line:#a3b2b8; --cat-face:#f0ede5; --cat-prop:#354359; --cat-accent:#d0b47d; }
html.day .cat.companion { --cat-fur:#f2ecdf; --cat-line:#b1a89a; --cat-face:#55514a; --cat-prop:#e5e9e5; --cat-accent:#b28c49; }
.companion svg { width: 100%; height: 100%; overflow: visible; }
.companion-shell { fill:var(--cat-fur); stroke:var(--cat-line); stroke-width:.8; }
.cat-nose { fill:var(--cat-face); opacity:.65; }
.companion-paw { fill:var(--cat-fur); stroke:var(--cat-line); stroke-width:.65; }
.companion-tail { stroke:var(--cat-fur); transform-origin:63px 65px; }
.companion-head, .companion-breathe { transform-origin:43px 74px; }
.companion-hands { transform-origin:43px 67px; }
.companion-shadow { fill:var(--cat-line); opacity:.13; }
.cat-eye-left { transform-origin:34px 45px; }
.cat-eye-right { transform-origin:53px 45px; }
.cat-eye-left, .cat-eye-right { animation:catEyeBlink 5.9s ease-in-out infinite paused; animation-delay:var(--idle-delay); }
.cat-eye-right { animation-delay:calc(var(--idle-delay) + .07s); }
.companion-breathe { animation:companionBreathe 4.8s cubic-bezier(.45,0,.55,1) infinite; }
.companion-breathe, .cat-star { animation-delay:var(--idle-delay); animation-play-state:paused; }
.companion.is-visible .companion-breathe, .companion.is-visible .cat-eye-left, .companion.is-visible .cat-eye-right, .companion.is-visible .cat-star { animation-play-state:running; }
.companion:focus-visible { outline:1px solid var(--cyan); outline-offset:3px; border-radius:50%; }
.companion-bubble { position:absolute; top:0; right:-10px; color:var(--gold); font:13px/1.4 monospace; opacity:0; pointer-events:none; }
.companion-code .companion-breathe { animation-name:catWorking; }
.companion-love .companion-breathe { animation-duration:5.2s; }
.companion-curious .companion-breathe { animation-name:catReading; animation-duration:6s; }
.companion-celebrate .companion-breathe { animation-duration:3.8s; }
.companion-celebrate .cat-star { animation:catStar 3.5s ease-in-out infinite paused; transform-origin:70px 14px; }
@keyframes companionBreathe { 0%,100% { transform:translateY(0) scale(1); } 50% { transform:translateY(-1.5px) scale(1.015,1.025); } }
@keyframes catEyeBlink { 0%,43%,47%,100% { transform:scaleY(1); } 45% { transform:scaleY(.08); } }
@media (prefers-reduced-motion: reduce) {
  .cat.companion *, .cat.companion svg { animation: none !important; }
}
@keyframes catWorking { 0%,100% { transform:translateY(0) rotate(-1deg); } 50% { transform:translateY(1px) rotate(1deg); } }
@keyframes catReading { 0%,100% { transform:rotate(-2deg); } 50% { transform:rotate(2deg); } }
@keyframes catStar { 0%,100% { opacity:.35; transform:scale(.8) rotate(-8deg); } 50% { opacity:.9; transform:scale(1) rotate(8deg); } }
@media(max-width:640px) { .cat.companion { width:55px; height:55px; top:-48px; right:12px; } }
.panel { scroll-margin-top: 150px; }

.pub-badges .badge { box-shadow: none; }
@media (max-width: 640px) {
  .moon-wrap { transform: scale(.24) !important; transform-origin: top left; }
}
/* A tapered light trail: a broad warm head and a thin, fading cool tail. */
.portrait-orbit { position:absolute; inset:-6px; width:calc(100% + 12px); height:calc(100% + 12px); overflow:visible; pointer-events:none; transform:translateZ(1px); --trail-color:#90d9dc; --trail-head:#f5d59d; filter:drop-shadow(0 0 3px #8dd6e640); }
html.day .portrait-orbit { --trail-color:#428d98; --trail-head:#bd8c46; filter:drop-shadow(0 0 2px #497f8b25); }
.portrait-orbit rect { fill:none; stroke:var(--trail-color); stroke-linecap:round; stroke-dasharray:8.5 991.5; stroke-dashoffset:var(--trail-start); animation:portraitTrail 9s linear infinite; }
.portrait-orbit rect:nth-child(-n+3) { stroke:var(--trail-head); }
@keyframes portraitTrail { from { stroke-dashoffset:var(--trail-start); } to { stroke-dashoffset:calc(var(--trail-start) - 1000px); } }
.cursor-lens { position:fixed; top:0; left:0; width:64px; height:64px; z-index:10000;
  border-radius:50%; pointer-events:none; opacity:0; transition:opacity .22s;
  backdrop-filter:url(#page-liquid-optics); -webkit-backdrop-filter:url(#page-liquid-optics);
  background:radial-gradient(circle,transparent 56%,#a9dcd604 77%,#bde8df0a 95%,transparent 100%);
  box-shadow:inset 0 0 0 .7px #b8dfdb40,0 0 8px #93c5c608;
}
.cursor-lens::after { content:''; position:absolute; inset:0; border-radius:50%;
  background:conic-gradient(from 35deg,transparent 0deg,transparent 90deg,#b4d7d233 180deg,#e4eee2bb 245deg,transparent 305deg);
  -webkit-mask:radial-gradient(transparent 68%,#000 69%,#000 70%,transparent 71%);mask:radial-gradient(transparent 68%,#000 69%,#000 70%,transparent 71%);
}
.cursor-lens.visible { opacity:1; }
html.day .cursor-lens { box-shadow:inset 0 0 0 .7px #40858235,0 0 8px #497f8b08; }
html.day .cursor-lens::after { background:conic-gradient(from 35deg,transparent 0deg,transparent 90deg,#4c8a8733 180deg,#407d7ca0 245deg,transparent 305deg); }
@media(prefers-reduced-motion:reduce) { .cursor-lens { display:none; } .portrait-orbit rect { animation:none; } }
/* Astronomy occupies the margins; content remains on calm, opaque surfaces. */
#cosmicCanvas { position:fixed; inset:0; width:100%; height:100%; z-index:-4; pointer-events:none; image-rendering:pixelated; }
.cosmic-ready .cloud, .cosmic-ready .mountains, html.cosmic-ready .ink-geese { display:none; }
html.cosmic-ready .moon-wrap { top:76px; right:35px; transform:scale(.6) !important; transform-origin:top right; animation:none; }
html.cosmic-ready .panel { background:rgba(23,29,49,.94); }
html.cosmic-ready.day .panel { background:rgba(255,253,247,.95); }
@media(max-width:640px) { html.cosmic-ready .moon-wrap { top:3px; left:48px; right:auto; transform:scale(.24) !important; transform-origin:top left; } }
/* Resource actions are distinct from venue/status badges, with generous hit areas. */
.pub-card .pub-links { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.pub-card .pub-links a, html.day .pub-card .pub-links a {
  display:inline-flex; align-items:center; gap:7px; min-height:34px; padding:7px 10px;
  border:1px solid #86c9d43b; border-radius:5px; background:#83cec90e;
  color:#a6deda; font:500 11px/1.4 var(--font-body); text-decoration:none;
  transition:background .18s,border-color .18s,color .18s;
}
html.day .pub-card .pub-links a { background:#f0f6f3; border-color:#bfd4cf; color:#316e76; }
.pub-card .pub-links a:hover { background:#83cec923; border-color:#83cec985; color:#e0f5e9; }
html.day .pub-card .pub-links a:hover { background:#dfede7; border-color:#77a59f; color:#234e56; }
.pub-links svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linejoin:round; stroke-linecap:round; }
.resource-arrow { font-size:12px; opacity:.6; margin-left:3px; }
.pub-links a:focus-visible { outline:2px solid var(--cyan); outline-offset:3px; }
.pixel-transition-active .portrait-orbit rect, .pixel-transition-active .companion * { animation-play-state:paused !important; }
/* Idle activities have separate paw/body layers; gaze and reactions stay spring-driven. */
.companion-code .cat-paw-left { animation:catTypeLeft 1.25s ease-in-out infinite paused; }
.companion-code .cat-paw-right { animation:catTypeRight 1.25s ease-in-out infinite paused; }
.companion-code .companion-breathe { animation-duration:3.8s; }
.companion-sport .companion-breathe { animation:catJog 1.1s ease-in-out infinite paused; }
.companion-sport .cat-paw-left { animation:catStride 1.1s ease-in-out infinite paused; }
.companion-sport .cat-paw-right { animation:catStride 1.1s ease-in-out -.55s infinite paused; }
.companion-sport .cat-ball { transform-origin:73px 72px; animation:catBall 3.5s linear infinite paused; }
.companion-love .companion-tail { animation:catTailWave 4s ease-in-out infinite paused; }
.companion-celebrate .cat-paw-right { transform:translate(-1px,-10px) rotate(-8deg); transform-origin:58px 69px; }
.companion.is-visible .cat-paw-left, .companion.is-visible .cat-paw-right, .companion.is-visible .cat-ball, .companion.is-visible .companion-tail { animation-play-state:running; }
@keyframes catTypeLeft { 0%,40%,100% { transform:translateY(0); } 20%,65% { transform:translateY(-3px); } 80% { transform:translateY(1px); } }
@keyframes catTypeRight { 0%,20%,65%,100% { transform:translateY(-2px); } 40%,80% { transform:translateY(1px); } }
@keyframes catJog { 0%,50%,100% { transform:translateY(0) rotate(-1deg); } 25%,75% { transform:translateY(-2px) rotate(1deg); } }
@keyframes catStride { 0%,100% { transform:translate(-2px,0); } 50% { transform:translate(2px,-3px); } }
@keyframes catBall { to { transform:rotate(360deg); } }
@keyframes catTailWave { 0%,100% { rotate:-5deg; } 50% { rotate:12deg; } }

/* Official ACL mark; alpha masking keeps it legible in both themes. */
.portrait-links a { min-width:0; min-height:34px; padding:4px 0; }
.portrait-links .lico { width:14px; height:14px; margin-right:7px; }
.lico-acl { display:inline-block; background:currentColor; -webkit-mask:url("assets/acl-logo.svg") center/contain no-repeat; mask:url("assets/acl-logo.svg") center/contain no-repeat; }
.companion-sport { --cat-band:#d89a80; }
html.day .companion-sport { --cat-band:#b96f5d; }
.cat-band-ribbons { transform-origin:66px 37px; animation:headbandFlutter 1.1s ease-in-out infinite paused; }
.companion.is-visible .cat-band-ribbons { animation-play-state:running; }
@keyframes headbandFlutter { 0%,100% { transform:rotate(-7deg) scaleX(.95); } 50% { transform:rotate(7deg) scaleX(1.04); } }
.portrait-links .lico-acl { width:18px; margin-right:5px; }

/* A compact identity rail stays in view while the CV flows as one page. */
.container {
  max-width: 1200px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(38px, 5vw, 72px);
}
.profile-rail {
  position: fixed;
  top: 88px;
  left: max(22px, calc(50% - 600px + 22px));
  z-index: 2;
  width: 280px;
  padding: 30px 20px 26px 7px;
  border-right: 1px solid var(--line-soft);
}
.profile-rail .portrait-column { width: 252px; }
.profile-rail .identity-wordmark {
  width: 252px;
  height: 70px;
  margin: 22px 0 0;
}
.profile-rail .identity-wordmark h1 { font-size: 22px; }
.profile-rail .portrait-links { margin-top: 8px; }
.profile-details {
  display: grid;
  gap: 2px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.profile-detail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  color: var(--dim);
  font: 11px/1.5 var(--font-body);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.profile-detail svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profile-detail.featured { color: var(--cyan); }
.profile-detail.featured:hover, .profile-detail.featured:focus-visible {
  color: var(--cream);
  border-bottom-color: var(--gold);
}
.profile-detail.featured:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; }
.content-column { grid-column: 2; display: flex; flex-direction: column; gap: 52px; min-width: 0; }
.content-column .hero {
  display: block;
  padding: 40px 0 22px;
  scroll-margin-top: 100px;
}
.content-column .hero-info { width: 100%; }

@media (min-width: 861px) {
  .content-column { padding-top: 70px; }
  .content-column .hero { display: none; }
}
@media (min-width: 861px) and (max-height: 800px) {
  .profile-rail {
    top: 58px;
    padding-top: 12px;
    padding-right: 8px;
    padding-bottom: 12px;
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

@media (max-width: 860px) {
  .container { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .profile-rail {
    position: static;
    width: auto;
    left: auto;
    padding: 28px 0 0;
    border-right: 0;
    border-bottom: 0;
  }
  .profile-rail .portrait-column { margin: 0 auto; }
  .profile-rail .portrait-links { margin-top: 18px; }
  .profile-details { display: none; }
  .content-column { grid-column: 1; gap: 36px; }
  .content-column .hero { padding: 28px 0 8px; }
}

@media (max-width: 640px) {
  .navbar { width: 100%; box-sizing: border-box; overflow: hidden; }
  .navbar .nav-logo { display: none; }
  .navbar .nav-links {
    width: 100%;
    box-sizing: border-box;
    padding-left: 76px;
    justify-content: space-between;
    gap: 4px;
  }
}

/* The theme control belongs to the navigation, not the illustrated sky. */
.navbar { padding-top: 9px; padding-bottom: 9px; }
.nav-controls { display: flex; align-items: center; gap: 18px; min-width: 0; }
.navbar .moon-wrap, html.cosmic-ready .navbar .moon-wrap {
  position: relative;
  inset: auto;
  z-index: 1;
  flex: none;
  display: block;
  width: 30px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  filter: none;
  transform: none !important;
  animation: none;
  transition: background .2s ease, border-color .2s ease;
}
.navbar .moon-wrap:hover, .navbar .moon-wrap:focus-visible {
  background: var(--panel-2);
  border-color: var(--line);
  outline: none;
}
.navbar .moon-wrap #moon, .navbar .moon-wrap #sun {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.18);
  transform-origin: center;
}
@media (max-width: 640px) {
  .navbar { padding: 8px 12px; }
  .navbar .nav-logo { display: inline-flex; flex: none; }
  .navbar .nav-controls { flex: 1; justify-content: flex-end; gap: 7px; }
  .navbar .nav-links { width: auto; padding-left: 0; gap: clamp(4px, 1.3vw, 9px); }
  .navbar .moon-wrap, html.cosmic-ready .navbar .moon-wrap { width: 30px; height: 28px; }
}
