:root {
  --bg: #f4f2ee;
  --paper: #fbfaf7;
  --ink: #2b2622;
  --muted: #8b847c;
  --line: #e3ded6;
  --pink: #ec92ab;
  --pink-l: #fbe3ea;
  --orange: #e48d3e;
  --orange-l: #fbe6cf;
  --green: #73a843;
  --px: "Silkscreen", "Courier New", monospace;
  --display: "Pixelify Sans", "Silkscreen", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--pink-l); }

/* ---------- nav ---------- */
.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { font-family: var(--px); font-size: 14px; text-decoration: none; letter-spacing: .04em; }
.nav-end { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav nav { display: flex; gap: 22px; }
.lang-switch { display: inline-flex; border: 2px solid var(--ink); background: var(--paper); }
.lang-switch button {
  font-family: var(--px); font-size: 11px; border: 0; background: transparent;
  color: var(--muted); padding: 6px 8px; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.t-zh { display: none; }
html[data-lang="zh"] .t-en { display: none; }
html[data-lang="zh"] .t-zh { display: inline; }
.nav nav a {
  font-family: var(--px); font-size: 12px; text-decoration: none; color: var(--muted);
  text-transform: lowercase;
}
.nav nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  text-align: center;
}
.name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(44px, 9vw, 88px);
  line-height: 1;
  margin: 34px 0 10px;
  letter-spacing: .01em;
}
.tagline { margin: 0; color: var(--muted); font-size: 15px; }
.garden-wrap { margin-top: 18px; width: 100%; }
#garden {
  display: block; width: 100%;
  image-rendering: pixelated;
  cursor: grab;
  touch-action: pan-y;
}
.hint {
  font-family: var(--px); font-size: 11px; color: #b2aaa1; margin: 6px 0 0;
  text-transform: lowercase;
}
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-mouse { display: none; } .hint-touch { display: inline; } }

/* ---------- work ---------- */
.work, .about {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  border-top: 2px dashed var(--line);
  padding-top: 28px;
  margin-bottom: 28px;
}
.label {
  font-family: var(--px); font-weight: 400; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin: 0;
}
.entrances { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 32px; }
.entrance {
  min-height: 92px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--line);
  font-family: var(--px);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.entrance-label { display: inline-flex; align-items: center; gap: 10px; }
.entrance-count { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.entrance-count b { font-family: var(--display); font-size: 36px; font-weight: 600; }
.entrance-count small { margin-top: 4px; font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.entrance:hover { transform: translate(-2px, -2px); }
.entrance[aria-selected="true"] { background: var(--paper); }
.entrance[data-cat="personal"][aria-selected="true"] { box-shadow: 6px 6px 0 var(--pink); }
.entrance[data-cat="commercial"][aria-selected="true"] { box-shadow: 6px 6px 0 var(--orange); }
.dot { width: 10px; height: 10px; display: inline-block; }
.dot.pink { background: var(--pink); }
.dot.orange { background: var(--orange); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 36px 28px;
}
.grid.portrait {
  grid-template-columns: repeat(auto-fill, minmax(150px, 200px));
  justify-content: start;
  gap: 28px 16px;
}
.grid.fade { animation: fade .4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.card { position: relative; }
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
  transition: transform .15s steps(2), box-shadow .15s steps(2);
  box-shadow: 4px 4px 0 var(--accent, var(--pink));
}
.thumb.portrait { aspect-ratio: 9 / 16; background: #171412; }
.thumb img.ph { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated; }
.thumb img.real {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; image-rendering: auto; background: #171412;
}
.thumb.has-cover .ph,
.thumb.has-cover .ph-badge { visibility: hidden; }
.play {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  background: var(--paper); border: 2px solid var(--ink);
  display: grid; place-items: center;
  transition: transform .15s steps(2);
}
.play svg { width: 20px; height: 20px; margin-left: 3px; }
.dur {
  position: absolute; right: 8px; bottom: 8px;
  font-family: var(--px); font-size: 10px;
  background: var(--ink); color: var(--paper); padding: 2px 6px;
}
.card-hit {
  position: absolute; inset: 0; z-index: 2;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.card-hit:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.card:hover .thumb { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent, var(--pink)); }
.card:hover .play { transform: scale(1.1); }
.ph-badge {
  position: absolute; left: 8px; top: 8px; z-index: 1;
  font-family: var(--px); font-size: 10px; letter-spacing: .04em;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
  padding: 3px 6px;
}
.card h3 { font-size: 17px; font-weight: 600; margin: 16px 0 2px; line-height: 1.35; overflow-wrap: anywhere; }
.archive {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 24px 72px;
}
.archive-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  margin: 10px 0 20px;
}
.archive-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 28px; align-items: start; }
.archive-story { margin: 0; max-width: 62ch; color: #4a443e; font-size: 16px; }
.card-archive { max-width: 280px; }
.play-tip { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.55; max-width: 68ch; }
.player-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
#p-story { margin: 0 0 12px; color: #4a443e; }
.card .meta, .player .meta {
  font-family: var(--px); font-size: 10px; color: var(--muted);
  letter-spacing: .03em; margin: 0; text-transform: uppercase;
}
.card .sum { margin: 6px 0 0; color: #5f5851; font-size: 14px; line-height: 1.55; }

/* ---------- about ---------- */
.about {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px;
  border-top: 2px dashed var(--line);
  margin-top: 24px;
}
.about-body { max-width: 620px; }
.about-body p { margin: 0 0 18px; font-size: 17px; color: #4a443e; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.contact #links a { font-size: 14px; color: var(--muted); margin-right: 14px; }
.px-btn {
  font-family: var(--px); font-size: 12px; text-decoration: none;
  border: 2px solid var(--ink); background: var(--paper);
  padding: 9px 16px; box-shadow: 3px 3px 0 var(--ink);
  display: inline-block; transition: transform .1s steps(2), box-shadow .1s steps(2);
}
.px-btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--pink); }
.px-btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }

.foot {
  max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: var(--px); font-size: 10px; color: #b2aaa1; text-transform: lowercase;
}

/* ---------- player ---------- */
.player {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(43, 38, 34, .55);
}
.player[hidden] { display: none; }
.player-inner {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--accent, var(--pink));
  padding: 16px;
  position: relative;
}
.close {
  font-family: var(--px); font-size: 11px;
  background: none; border: 0; cursor: pointer; color: var(--muted);
  display: block; margin: 0 0 10px auto; padding: 4px;
}
.close:hover { color: var(--ink); }
.player-inner.fit-portrait { width: min(440px, calc(100vw - 32px)); }
.frame {
  position: relative;
  width: min(100%, calc(62vh * 16 / 9));
  aspect-ratio: 16 / 9;
  margin-inline: auto;
  background: #1d1a17;
  border: 2px solid var(--ink);
}
.frame.portrait {
  width: auto;
  height: min(68vh, 760px);
  max-width: 100%;
  aspect-ratio: 9 / 16;
}
.frame iframe, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
.frame .soon {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--px); color: var(--paper); font-size: 14px; text-align: center;
  background-size: cover; background-position: center; image-rendering: pixelated;
}
.frame .soon span { background: rgba(29,26,23,.75); padding: 8px 14px; }
.player-info { padding: 18px 4px 6px; max-width: 680px; }
.player-info h3 { font-size: 22px; margin: 4px 0 8px; line-height: 1.3; }
.player-info p { margin: 0 0 12px; color: #4a443e; }
.open-link { font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .nav { padding: 16px; gap: 12px; }
  .nav-end { gap: 12px; }
  .nav nav { gap: 12px; }
  .work, .about { padding: 40px 16px; }
  .entrances { grid-template-columns: 1fr; }
  .entrance { min-height: 76px; }
  .grid { grid-template-columns: 1fr; gap: 32px; }
  .archive-layout { grid-template-columns: 1fr; }
  .card-archive { max-width: none; }
  .about { grid-template-columns: 1fr; gap: 12px; }
  .tab { padding: 7px 10px; }
  .player-inner { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
