/* 陈壬翰 · 首页
   读作：给看作品的人的个人站。前半是星夜油画和纸本拼贴，
   简历页才进入终端绿（另一份样式）。
   宋体：首屏压在《心经》画上，正文要能和画里的字坐在一起。
   强调色只锁朱砂。金色细线只属于油画框，不进按钮。
   贴纸的米色是纸，不是页面底色。 */

@font-face {
  font-family: "WenKai";
  src: url("fonts/wenkai-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "WenKai";
  src: url("fonts/wenkai-medium.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #070b12;
  --text: #f3efe4;
  --muted: #b7b1a4;
  --line: rgba(243, 239, 228, 0.18);
  --cinnabar: #c42318;
  --gold: #c6a15a;
  --sticker: #f7f4ee;
  --nav-h: 64px;
  --wrap: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; color-scheme: dark; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "WenKai", "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; }
button, a { font: inherit; }
::selection { background: var(--cinnabar); color: #fff; }
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  background: #fff;
  color: #111;
  padding: 8px 12px;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(var(--wrap), calc(100% - 48px));
  margin-inline: auto;
}

@view-transition { navigation: auto; }
.hero h1 { view-transition-name: person; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 18px 28px 0;
  pointer-events: none;
  background: none;
}
.nav-toggle,
.nav nav { pointer-events: auto; }
.nav nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 2px;
  background: rgba(0, 16, 6, .62);
  border: 1px solid rgba(57, 255, 115, .38);
  box-shadow: 0 0 24px rgba(0, 255, 80, .08), inset 0 0 0 1px rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.nav-glider {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: 2px;
  background: rgba(57, 255, 115, .14);
  box-shadow: inset 0 0 0 1px rgba(57, 255, 115, .75);
  opacity: 0;
  transition: transform .45s cubic-bezier(.22, .8, .24, 1), width .45s cubic-bezier(.22, .8, .24, 1), height .45s cubic-bezier(.22, .8, .24, 1), opacity .25s;
}
.nav-glider.is-on { opacity: 1; }
.nav nav a {
  position: relative;
  z-index: 1;
  color: #9dffb8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  padding: 8px 14px;
  border-radius: 2px;
}
.nav nav a i {
  margin-right: 8px;
  color: #39ff73;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.nav nav a:hover,
.nav nav a[aria-current="page"] { color: #e9ffef; }
.nav-toggle {
  display: none;
  background: rgba(0, 16, 6, .8);
  color: #9dffb8;
  border: 1px solid rgba(57, 255, 115, .4);
  border-radius: 2px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
}
.nav-toggle:active, .btn:active, .tool:active { transform: scale(0.98); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 88px 32px 76px;
  overflow: hidden;
}
.hero {
  background: #000;
  justify-content: space-between;
  gap: 24px;
}
#rain {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-copy, .hero-side { position: relative; z-index: 2; }
.hero-copy { max-width: 640px; }
.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 6px;
}
.hero-photos { display: flex; gap: 10px; }
.hero-photos img {
  width: 132px;
  height: 168px;
  object-fit: cover;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .45);
}
.crt {
  width: min(300px, 72vw);
  padding: 8px;
  background: #141814;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .5);
}
.crt-screen {
  position: relative;
  padding: 14px 16px 10px;
  background: #031208;
  color: #b8ffc9;
  font-family: ui-monospace, "SF Mono", "Source Code Pro", monospace;
  letter-spacing: .06em;
  line-height: 1.55;
  text-shadow: 0 0 8px rgba(0, 255, 65, .55);
  overflow: hidden;
}
.crt-screen p { margin: 0; }
.crt-screen a { color: inherit; text-decoration: none; }
.crt-kicker { color: #67ff93; font-size: 12px; letter-spacing: .22em; }
.crt-cursor { animation: crt-blink 1s steps(1) infinite; }
.crt-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
@keyframes crt-blink { 50% { opacity: 0; } }
.hero h1 {
  margin: 0;
  color: #d8ffe6;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "WenKai", monospace;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.14em;
  text-shadow: 0 0 18px rgba(0, 255, 80, .45);
}
.hero h1::before {
  content: "> ";
  color: #39ff73;
}
.roles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  max-width: 42em;
  margin: 16px 0 0;
  color: #9dffb8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "WenKai", monospace;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
.hero .roles span:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 10px 2px;
  border-radius: 50%;
  background: #39ff73;
  vertical-align: middle;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero-tear {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 58px;
  z-index: 2;
  background: var(--ink);
  clip-path: polygon(
    0 68%, 7% 38%, 15% 76%, 24% 30%, 36% 72%,
    48% 26%, 59% 78%, 71% 34%, 83% 70%, 93% 28%,
    100% 62%, 100% 100%, 0 100%
  );
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-solid { background: var(--cinnabar); color: #fff; }
.btn-line { background: rgba(7, 11, 18, .45); color: var(--text); border-color: rgba(243, 239, 228, .55); }
.btn-green { background: #00ff41; color: #04140a; border-color: #00ff41; }

/* ---------- veil ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--ink);
  pointer-events: none;
  visibility: hidden;
}
.veil.is-shut {
  visibility: visible;
  pointer-events: auto;
  animation: shut .46s cubic-bezier(.7, 0, .2, 1) both;
}
.veil.is-open {
  visibility: visible;
  animation: open .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes shut {
  from { clip-path: inset(100% 0 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes open {
  from { clip-path: inset(0 0 0 0); }
  to { clip-path: inset(0 0 100% 0); }
}

/* ---------- works ---------- */
#works, #projects, #contact { scroll-margin-top: 80px; }

#works { padding-top: 28px; }
.projects h2,
.contact h2,
.door h2,
.cat h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.projects h2,
.contact h2,
.door h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}
.projects .lede,
.contact .lede,
.door p {
  margin: 10px 0 0;
  max-width: 65ch;
  color: var(--muted);
}
.tool {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}
.cat { padding: 22px 0 8px; }
.sheet-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.river {
  overflow: visible;
  padding: 12px 0 28px;
  cursor: grab;
  touch-action: pan-y;
}
.river.is-grabbing { cursor: grabbing; }
.river-track {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 22px;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  will-change: transform;
}
.river .piece { width: min(280px, 100%); min-width: 0; }
.piece { overflow: hidden; }

.wall {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 64px;
  perspective: 1100px;
  padding: 12px 0 28px;
}
.wall .piece {
  width: min(240px, 36vw);
  transform-style: preserve-3d;
}

.sheet {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: min(1040px, calc(100% - 48px));
  padding-bottom: 28px;
}
.sheet .piece { touch-action: none; cursor: grab; }
.sheet .piece.is-lifted { cursor: grabbing; z-index: 5; }

.piece {
  position: relative;
  margin: 0;
  user-select: none;
  -webkit-user-drag: none;
}
.piece img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.piece-name {
  position: absolute;
  left: 8px;
  bottom: 6px;
  padding: 2px 6px;
  background: rgba(7, 11, 18, .86);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.piece:hover .piece-name,
.piece:focus-visible .piece-name,
.piece.is-lifted .piece-name { opacity: 1; }
.piece.is-sutra {
  background: #140e08;
  padding: 6px;
  box-shadow: 0 0 0 1px var(--gold), 0 14px 28px rgba(2, 6, 16, .5);
}
.piece.is-poster { box-shadow: 0 16px 36px rgba(2, 6, 16, .5); }
.piece.is-sticker {
  background: var(--sticker);
  padding: 7px 7px 20px;
  box-shadow: 0 10px 22px rgba(2, 6, 16, .38);
}
.piece.is-sticker::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 46%, #d5d0c6 50%, #fff 64%);
  transition: width .2s, height .2s;
}
.piece.is-sticker.is-lifted {
  box-shadow: 0 22px 36px rgba(2, 6, 16, .55);
}
.piece.is-sticker.is-lifted::after { width: 42px; height: 42px; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 11, 18, .94);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 24px;
}
.lb-close { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
.lb-prev { grid-column: 1; grid-row: 2; }
.lb-stage { grid-column: 2; grid-row: 2; }
.lb-next { grid-column: 3; grid-row: 2; }
.lb[hidden] { display: none; }
.lb-stage { text-align: center; }
.lb img {
  max-width: min(1100px, 100%);
  max-height: calc(100dvh - 140px);
  width: auto;
  height: auto;
  margin: 0 auto;
}
.lb figcaption {
  margin-top: 12px;
  color: var(--text);
}
.lb figcaption span { color: var(--muted); margin-left: 8px; }
.lb button {
  background: rgba(7, 11, 18, .7);
  color: var(--text);
  border: 1px solid var(--line);
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}
html.lb-open { overflow: hidden; }

/* ---------- projects ---------- */
.projects { padding: 88px 0 20px; }
.proj-list { margin-top: 28px; border-bottom: 1px solid var(--line); }
.proj {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.proj img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  background: #0c1018;
}
.proj img.is-square { object-fit: cover; }
.mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--text);
}
.proj h3 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.proj p { margin: 4px 0 0; color: var(--muted); }
.proj-links { display: flex; gap: 16px; }
.proj-links a { color: var(--text); }

/* ---------- contact + door ---------- */
.contact { padding: 88px 0 48px; }
.contact-board {
  position: relative;
  overflow: hidden;
  padding: 48px 8px 56px;
}
.contact-board::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  left: var(--cx, 20%);
  top: var(--cy, 40%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 35, 24, .28), transparent 70%);
  pointer-events: none;
}
.contact-place { position: relative; margin: 12px 0 0; color: var(--muted); }
.contact-phone {
  position: relative;
  display: block;
  margin-top: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.contact-wechat {
  position: relative;
  margin: 12px 0 0;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}
.door {
  position: relative;
  background: #100e0c;
  color: var(--text);
  padding: 96px 0 108px;
}
.door .btn { margin-top: 22px; }
.btn-file { background: #f3e6c8; color: #241c16; border-color: #f3e6c8; }
.colophon {
  margin: 0;
  padding: 28px 32px 36px;
  color: var(--muted);
  font-size: 14px;
}

.piece.is-liquid { position: relative; }
.piece.is-liquid canvas.liquid {
  position: absolute;
  pointer-events: none;
}
.piece.is-liquid.is-flowing img { opacity: 0; }

.live-list { display: grid; gap: 28px; margin-top: 28px; }
.live {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.live-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.live-head h3 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 1.6rem; }
.live-logo { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; background: #0c1018; }
.live-head a { color: var(--text); }

.book-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.book-picks button, .book-chapters button {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}
.book-picks button.is-on, .book-chapters button.is-on { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }
.book-meta { color: var(--muted); margin: 14px 0 8px; }
.book-pillars { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.book-pillars span { display: grid; }
.book-pillars b { font-weight: 700; font-size: 13px; color: var(--muted); }
.book-chapters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.book-page { max-width: 65ch; min-height: 4.5em; }
.book-page h4 { margin: 0 0 8px; }
.book-page p { margin: 0; color: var(--muted); }

.live-ora { display: block; }
.reveal-stage--fortune { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 18px; }
.flip { width: min(210px, 56vw); perspective: 1100px; }
.flip__btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; }
.flip__inner {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3.4;
  transform-style: preserve-3d;
  transition: transform .92s cubic-bezier(.18, .9, .18, 1);
}
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }
.flip__face { position: absolute; inset: 0; backface-visibility: hidden; overflow: hidden; box-shadow: 0 10px 26px rgba(0,0,0,.55); }
.flip__face--front { transform: rotateY(180deg); }
.flip__face img, .card-back__art { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-back__art { background: var(--card-back) center / cover no-repeat; }
.deck-caption { margin: 0; color: var(--muted); }
.hecan {
  --syn-paper: #f2ead8;
  --syn-ink: #24231f;
  --syn-line: rgba(75, 67, 54, .22);
  --syn-cinnabar: #a64f40;
  --serif: "WenKai", "Songti SC", serif;
  margin-top: 16px;
  padding: 22px 18px 16px;
  color: var(--syn-ink);
  background: #f2ead8 url("migrated/xuan-paper.jpg") center / cover;
}
.syn-ink-overview-head { position: relative; display: grid; justify-items: center; gap: 4px; padding-bottom: 12px; text-align: center; }
.syn-ink-overview-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(75,67,54,.28) 8%, rgba(75,67,54,.28) 92%, transparent); }
.syn-ink-overview-head > span, .syn-ink-overview-head > small { color: #817966; font-size: 11px; letter-spacing: .18em; }
.syn-ink-overview-head h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: .16em; font-weight: 700; }
.syn-ink-overview-head p { margin: 0; letter-spacing: .12em; }
.syn-ink-system-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--syn-line); margin-top: 14px; }
.syn-ink-card { --syn-card-delay: calc(var(--card-index) * 220ms); padding: 16px 18px 18px; border-right: 1px solid var(--syn-line); border-bottom: 1px solid var(--syn-line); opacity: 0; animation: syn-ink-card-in .72s cubic-bezier(.22,.68,.28,1) forwards; animation-delay: var(--syn-card-delay); }
.syn-ink-card:nth-child(2n) { border-right: 0; }
.syn-ink-card:nth-child(n+3) { border-bottom: 0; }
.syn-ink-card-top { display: flex; gap: 8px; align-items: center; color: #777164; font-size: 11px; letter-spacing: .14em; }
.syn-ink-number { color: var(--syn-cinnabar); }
.syn-ink-method { display: block; margin: 10px 0 4px; color: var(--syn-cinnabar); letter-spacing: .16em; font-size: 12px; }
.syn-ink-card-body { display: grid; grid-template-columns: minmax(0, .9fr) minmax(150px, 1.1fr); gap: 14px; align-items: center; margin-top: 8px; }
.syn-ink-copy h3 { margin: 0 0 6px; font-size: 22px; }
.syn-ink-copy p, .syn-ink-copy small { margin: 0; color: #6d685d; }
.syn-ink-copy small { display: block; margin-top: 8px; }
.syn-ink-visual { display: grid; justify-items: center; min-width: 0; }
.syn-mini-bazi { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; border-block: 1px solid rgba(72,65,53,.16); }
.syn-mini-pillar { display: grid; justify-items: center; padding: 8px 2px; border-left: 1px solid rgba(72,65,53,.14); opacity: 0; animation: syn-ink-pillar-in .66s cubic-bezier(.22,.68,.28,1) forwards; animation-delay: calc(var(--syn-card-delay) + var(--pillar-index) * 120ms + 110ms); }
.syn-mini-pillar:last-child { border-right: 1px solid rgba(72,65,53,.14); }
.syn-mini-pillar small { color: #777164; }
.syn-mini-pillar b { font-size: 28px; font-weight: 700; line-height: 1.05; }
.syn-mini-pillar.is-day b:first-of-type { color: var(--syn-cinnabar); }
.syn-mini-ziwei { width: min(100%, 230px); }
.syn-mini-ziwei .zw-grid.syn-mini-ziwei-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 1px; width: 100%; aspect-ratio: 1; overflow: hidden; background: rgba(74, 65, 50, .3); }
.syn-mini-ziwei-grid .zw-palace { min-width: 0; min-height: 0; padding: 3px 2px; overflow: hidden; border: 0; background: rgba(248, 242, 229, .86); color: inherit; font: inherit; text-align: left; animation: syn-ink-palace-in .58s ease both; animation-delay: calc(var(--syn-card-delay) + var(--zw-order, 0) * 34ms + 130ms); }
.syn-mini-ziwei-grid .zw-palace.is-selected { background: rgba(166, 79, 64, .11); box-shadow: inset 0 0 0 1px rgba(166, 79, 64, .65); }
.syn-mini-ziwei-grid .zw-palace-top { display: flex; gap: 2px; line-height: 1; }
.syn-mini-ziwei-grid .zw-palace-top > small { color: #7a7264; font-size: 8px; }
.syn-mini-ziwei-grid .zw-palace-top > span, .syn-mini-ziwei-grid .zw-palace-top > i, .syn-mini-ziwei-grid .zw-overlay, .syn-mini-ziwei-grid .zw-moving, .syn-mini-ziwei-grid .zw-minor { display: none; }
.syn-mini-ziwei-grid .zw-stars { display: flex; flex-wrap: wrap; gap: 1px; margin: 2px 0; }
.syn-mini-ziwei-grid .zw-star > b { color: #4b4a43; font-size: 8px; font-weight: 500; }
.syn-mini-ziwei-grid .zw-star > small, .syn-mini-ziwei-grid .zw-star .zw-hua { display: none; }
.syn-mini-ziwei-grid .zw-palace-footer { display: flex; justify-content: center; }
.syn-mini-ziwei-grid .zw-palace-footer > b { color: #413d34; font-size: 9px; font-weight: 500; }
.syn-mini-ziwei-grid .zw-palace-footer > span { display: none; }
.syn-mini-ziwei-grid .syn-mini-ziwei-center { display: flex; grid-row: 2 / 4; grid-column: 2 / 4; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: rgba(241, 233, 216, .96); }
.syn-mini-ziwei-center > span { color: #918675; font-size: 7px; letter-spacing: .16em; }
.syn-mini-ziwei-center > b { color: var(--syn-cinnabar); font-size: 15px; }
.syn-mini-ziwei-center > small { color: #817969; font-size: 8px; }
.syn-mini-ziwei-grid .zw-connections { display: none; }
.syn-mini-western { width: min(100%, 230px); }
.syn-mini-western .astro-svg-full { display: block; width: 100%; height: auto; filter: grayscale(.88) sepia(.12) contrast(.94); }
.syn-mini-western .astro-svg-full > circle { animation: syn-ink-wheel-draw 1.2s ease both; animation-delay: calc(var(--syn-card-delay) + 180ms); }
.syn-mini-western .western-aspect-line { stroke: #a64f40 !important; stroke-dasharray: 250; stroke-dashoffset: 250; animation: syn-ink-aspect-draw 1.3s ease forwards; animation-delay: calc(var(--syn-card-delay) + 480ms); }
.syn-mini-western .western-planet-hit { opacity: 0; animation: syn-ink-planet-in .48s ease forwards; animation-delay: calc(var(--syn-card-delay) + 760ms); }
.syn-mini-jyotish { position: relative; width: min(100%, 190px); padding-top: 14px; }
.syn-mini-d1-label { position: absolute; top: 0; left: 50%; color: #817966; font-size: 8px; letter-spacing: .16em; transform: translateX(-50%); }
.syn-mini-jyotish .rasi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 1px; aspect-ratio: 1; background: rgba(72, 65, 53, .24); }
.syn-mini-jyotish .rasi-cell, .syn-mini-jyotish .rasi-center { min-width: 0; min-height: 0; padding: 2px; background: rgba(249, 244, 233, .94); }
.syn-mini-jyotish .rasi-cell { display: grid; align-content: center; animation: syn-ink-palace-in .56s ease both; animation-delay: calc(var(--syn-card-delay) + 100ms + var(--syn-rasi-order, 0) * 26ms); }
.syn-mini-jyotish .rasi-cell.lagna { background: rgba(166, 79, 64, .12); box-shadow: inset 0 0 0 1px rgba(166, 79, 64, .56); }
.syn-mini-jyotish .rasi-cell small, .syn-mini-jyotish .rasi-cell .rasi-sign, .syn-mini-jyotish .rasi-cell .rasi-grahas { display: block; color: #625d52; font-size: 7px; line-height: 1.15; }
.syn-mini-jyotish .rasi-center { grid-row: 2 / 4; grid-column: 2 / 4; display: grid; place-items: center; align-content: center; }
.syn-mini-jyotish .rasi-center b { color: var(--syn-cinnabar); font-size: 13px; }
.syn-mini-jyotish .rasi-center span { color: #7a7264; font-size: 8px; text-align: center; }
.syn-book-overview-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.syn-book-overview-cta { min-height: 40px; padding: 0 16px; border: 0; background: #294d49; color: #f8f3e8; font: inherit; cursor: pointer; }
@keyframes syn-ink-card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes syn-ink-pillar-in { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: none; } }
@keyframes syn-ink-palace-in { from { opacity: .2; } to { opacity: 1; } }
@keyframes syn-ink-wheel-draw { from { opacity: .22; } to { opacity: 1; } }
@keyframes syn-ink-aspect-draw { to { stroke-dashoffset: 0; } }
@keyframes syn-ink-planet-in { to { opacity: 1; } }
.ora-row { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; margin-top: 16px; }
.ora-card { width: 168px; flex: 0 0 168px; min-width: 0; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; perspective: 1100px; }
.ora-card em { display: block; margin-top: 8px; font-style: normal; letter-spacing: .06em; }
.ora-inner { position: relative; display: block; width: 100%; aspect-ratio: .718; transform-style: preserve-3d; transition: transform .86s cubic-bezier(.22,.82,.2,1); }
.ora-card.is-open .ora-inner { transform: rotateY(180deg); }
.ora-back, .ora-front { position: absolute; inset: 0; backface-visibility: hidden; overflow: hidden; border-radius: 8px; }
.ora-back { background: #111 url("migrated/card-back.jpg") center / cover; }
.ora-front { transform: rotateY(180deg); }
.ora-front .holo-card, .ora-front .holo-card__translater, .ora-front .holo-card__rotator { width: 100%; height: 100%; aspect-ratio: auto; }
.ora-front .holo-card { pointer-events: none; }
.ora-front .holo-card__translater { --translate-z: 0.01px; transform: none; }
.ora-front .holo-card__front, .ora-front .holo-card__front * { backface-visibility: visible; }
.ora-card.is-open .holo-card { --card-opacity: .9; --pointer-x: 32%; --pointer-y: 18%; --rotate-x: 8deg; --rotate-y: -8deg; }
.ora-card.is-rare .ora-front { box-shadow: inset 0 0 0 3px #5f8fd0, 0 0 16px rgba(95,143,208,.4); }
.ora-card.is-epic .ora-front { box-shadow: inset 0 0 0 3px #9b6bd4, 0 0 16px rgba(155,107,212,.4); }
.ora-card.is-legend .ora-front { box-shadow: inset 0 0 0 3px #d4af37, 0 0 18px rgba(212,175,55,.45); }
@media (max-width: 800px) {
  .syn-ink-system-grid { grid-template-columns: 1fr; }
  .syn-ink-card { border-right: 0; }
  .syn-ink-card-body { grid-template-columns: 1fr; }
}

.live-muyu {
  --gold: #c4a36a;
  --text-faint: #6e5d4e;
  --text-dim: #9a8774;
  --bg: #16110e;
  --bg-soft: #261e19;
  --line: rgba(232, 217, 196, .18);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font-serif: "WenKai", "Songti SC", serif;
  margin-top: 12px;
  color: #e8d9c4;
}
.muyu-wrap { text-align: center; }
.count-label { font-size: 12px; letter-spacing: .2em; color: var(--text-faint); }
.count-big { font-size: 40px; font-weight: 700; line-height: 1; margin: 4px 0 0; }
.count-big em { font-style: normal; font-size: 16px; color: var(--text-dim); margin-left: 4px; font-weight: 400; }
.goal-row { width: min(70vw, 240px); margin: 16px auto 0; font-size: 12px; color: var(--text-faint); display: flex; justify-content: space-between; }
.goal-track { width: min(70vw, 240px); height: 3px; margin: 8px auto 0; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.goal-fill { height: 100%; width: 0; background: var(--gold); }
.live-muyu, .muyu-wrap, .muyu-stage { background: #16110e; }
.muyu-stage {
  margin: 10px auto 4px;
  width: min(46vw, 156px);
  height: min(46vw, 156px);
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  background: #16110e;
}
.muyu-fish-wrap { position: absolute; width: 78%; height: 78%; left: 3%; bottom: 1%; transform-origin: 50% 62%; }
.muyu-fish { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.muyu-mallet-pivot { position: absolute; left: 54%; top: 4%; width: 0; height: 0; z-index: 3; transform: rotate(-24deg); pointer-events: none; }
.muyu-mallet { position: absolute; left: -28px; top: 0; width: 56px; height: 200px; transform-origin: 50% 10px; }
.muyu-spark, .muyu-ring { position: absolute; left: 42%; top: 34%; pointer-events: none; opacity: 0; }
.muyu-spark { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: radial-gradient(circle, rgba(244,228,186,.95), rgba(196,163,106,0) 70%); z-index: 4; }
.muyu-ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 1.5px solid rgba(196,163,106,.55); border-radius: 50%; }
.muyu-stage.is-hit .muyu-mallet-pivot { animation: mallet-strike .5s cubic-bezier(.2,.82,.28,1); }
.muyu-stage.is-hit .muyu-fish-wrap { animation: fish-squash .5s cubic-bezier(.2,.82,.28,1); }
.muyu-stage.is-hit .muyu-spark { animation: spark .4s ease-out .12s; }
.muyu-stage.is-hit .muyu-ring { animation: ring .52s ease-out .12s; }
@keyframes mallet-strike { 0% { transform: rotate(-24deg); } 16% { transform: rotate(-38deg); } 32% { transform: rotate(18deg); } 42% { transform: rotate(8deg); } 56% { transform: rotate(16deg); } 100% { transform: rotate(-24deg); } }
@keyframes fish-squash { 0%, 28% { transform: scale(1); } 34% { transform: scale(.92, .84) rotate(-1.5deg); } 48% { transform: scale(1.045, 1.03); } 100% { transform: scale(1); } }
@keyframes spark { 0% { opacity: 0; transform: scale(.35); } 28% { opacity: 1; transform: scale(1.55); } 100% { opacity: 0; transform: scale(2.15); } }
@keyframes ring { 0% { opacity: .75; transform: scale(.55); } 100% { opacity: 0; transform: scale(2.7); } }
.float-layer { position: absolute; left: 50%; top: 8px; width: 160px; height: 40px; pointer-events: none; transform: translateX(-50%); z-index: 6; }
.float-txt { position: absolute; left: 50%; color: var(--gold); font-size: 15px; animation: float-rise 1.1s var(--ease) forwards; white-space: nowrap; }
@keyframes float-rise { 0% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -64px); } }
.muyu-hint { font-size: 12px; color: var(--text-faint); }

/* ---------- mobile ---------- */
@media (max-width: 899px) {
  .nav {
    padding: max(14px, env(safe-area-inset-top)) 16px 0;
    align-items: center;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  .nav nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    left: auto;
    width: min(240px, calc(100% - 32px));
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 6px;
    background: rgba(0, 16, 6, .96);
    border-color: rgba(57, 255, 115, .4);
  }
  .nav.is-open nav { display: flex; }
  .nav nav a { padding: 12px 14px; }
  .hero {
    min-height: 100dvh;
    height: auto;
    padding: max(88px, calc(env(safe-area-inset-top) + 64px)) 20px max(28px, env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 18px;
  }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: clamp(2.2rem, 12vw, 3.2rem); letter-spacing: 0.08em; }
  .roles { font-size: 0.92rem; }
  .hero-side { align-items: stretch; width: min(100%, 420px); gap: 12px; }
  .hero-photos { width: 100%; }
  .hero-photos img { flex: 1 1 0; width: 0; height: 38vw; min-height: 112px; max-height: 168px; }
  .crt { width: 100%; }
  .river { cursor: auto; }
  .river-track { width: min(100% - 32px, 1080px); }
  .river .piece { width: 100%; }
  .wall {
    width: min(100% - 32px, 1080px);
    margin-inline: auto;
    gap: 12px;
    padding-inline: 0;
  }
  .wall .piece { width: calc(50% - 6px); }
  .sheet { grid-template-columns: 1fr 1fr; width: min(100% - 32px, 1040px); gap: 12px; }
  .sheet .piece { touch-action: pan-y; }
  .piece-name { opacity: 1; }
  .projects { padding: 72px 0 12px; }
  .proj { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; }
  .proj img { width: 64px; height: 64px; }
  .proj-links { grid-column: 2; }
  .proj-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .door { padding-bottom: max(48px, env(safe-area-inset-bottom)); }
  .lb {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  .lb-close { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
  .lb-stage { grid-column: 1 / -1; grid-row: 2; }
  .lb-prev { grid-column: 1; grid-row: 3; justify-self: start; }
  .lb-next { grid-column: 2; grid-row: 3; justify-self: end; }
  .lb-stage { width: 100%; }
  .lb img { width: 100%; height: auto; max-height: calc(100dvh - 180px); object-fit: contain; }
  .wrap { width: min(var(--wrap), calc(100% - 32px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero-flow, #hero-flow { display: none; }
  .hero.is-flow .hero-media img { opacity: 1; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav.is-solid { background: var(--ink); backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
