:root {
  --background: #f7f4ee;
  --foreground: #10100f;
  --muted: #10100fad;
  --line: #10100f24;
  --accent: #c45c26;
  --accent-blue: #2f5dff;
  --ink: #0b0b0a;
  --ink-soft: #0b0b0a8a;
  --ink-mute: #0b0b0a6b;
  --ink-mid: #0b0b0a75;
  --ink-line: #0b0b0a29;
  --projects-bg: #efeae0;
  --ui-gutter-x: clamp(14px, 2.6vw, 44px);
  --ui-gutter-y: clamp(18px, 2.8vw, 40px);
  --ui-edge-x: var(--ui-gutter-x);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}
.preloader__wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.preloader__text {
  position: relative;
  z-index: 1;
  color: #ffffffeb;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(12px, 1.35vw, 15px);
  font-weight: 500;
}

/* WebGL — Signal Pole (primary home experience) */
.webgl-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #ffffff;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.45s ease;
}
.webgl-background canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.webgl-background.is-dimmed {
  opacity: 0;
  pointer-events: none;
}

/* Sticker tray — bottom-left, only on home */
.sticker-tray {
  position: absolute;
  right: var(--ui-edge-x);
  bottom: clamp(18px, 3.2vh, 40px);
  left: auto;
  z-index: 8;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(11, 11, 10, 0.08);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.sticker-tray.is-ready {
  display: flex;
}
.sticker-tray.is-impact {
  transform: scale(0.97);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.sticker-tray__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-right: 4px;
  user-select: none;
}
.sticker-tray__btn {
  appearance: none;
  border: 1.5px solid transparent;
  background: #f0ebe3;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  padding: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.sticker-tray__btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.sticker-tray__btn:hover {
  transform: translateY(-2px);
  background: #fff;
}
.sticker-tray__btn.is-active {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 1px var(--ink);
}

/* Floating sticker under cursor when hover stickerable surface */
.sticker-cursor-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 64px;
  pointer-events: none;
  z-index: 9;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}
.sticker-cursor-preview.is-on {
  opacity: 0.85;
  visibility: visible;
}
.sticker-cursor-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 3vh, 36px);
  /* horizontal center via gsap xPercent when animated; CSS fallback: */
  transform: translateX(-50%);
  z-index: 4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: #0b0b0a55;
  pointer-events: none;
  transition: opacity 0.5s ease;
  will-change: transform, opacity;
}
.scroll-hint.is-hidden {
  opacity: 0;
}
.page--home {
  pointer-events: none !important;
}
.page--home .home-profile,
.page--home .home-meta {
  pointer-events: none;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.9);
}

/* App shell — transparent to pointer so WebGL pole receives scroll/click on home */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Nav */
.site-nav {
  position: fixed;
  top: var(--ui-gutter-y);
  right: var(--ui-edge-x);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
}
.site-nav a {
  color: var(--ink-mid);
  letter-spacing: 0.045em;
  text-align: right;
  text-transform: uppercase;
  min-width: 74px;
  padding: 2px 0 3px;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
  font-weight: 400;
  line-height: 1;
  transition: color 0.18s, transform 0.18s;
}
.site-nav a:hover {
  color: var(--ink);
  transform: translateX(-2px);
}
.site-nav a.is-active {
  color: var(--ink);
}

/* Works flyout — hover 作品 → four mini street-sign plates on a silver pole,
   echoing the 3D signal-pole boards (yellow lightbox / paper / blue board / dark screen) */
.nav-works {
  position: relative;
  display: flex;
  justify-content: flex-end;
}
.works-flyout {
  position: absolute;
  top: -18px;
  right: calc(100% + 10px);
  width: min(212px, 62vw);
  padding: 2px 16px 6px 4px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(16px);
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s 0.28s;
}
/* Mini silver pole the plates hang from */
.works-flyout::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 5px;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, #b9bfc8 0%, #f3f5f8 45%, #d5dae1 70%, #9aa1ab 100%);
  box-shadow: 1.5px 2px 0 #0b0b0a24;
}
/* Head — little white sticker slapped on the pole */
.works-flyout__head {
  align-self: flex-start;
  display: inline-flex;
  gap: 8px;
  margin: 0 0 2px 2px;
  padding: 4px 9px 5px;
  background: #fffdf7;
  border: 1.5px solid #161615;
  border-radius: 5px;
  box-shadow: 2px 2.5px 0 #0b0b0a26;
  transform: rotate(-2.4deg);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* Category rows — signage plates; override the generic .site-nav a look */
.site-nav .works-flyout a {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
  margin: 6px -3px 6px 0;
  padding: 11px 12px 12px;
  border: 2px solid #161615;
  border-radius: 10px;
  box-shadow: 2.5px 3.5px 0 #0b0b0a2b;
  text-align: left;
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.2;
  opacity: 0;
  transform: translateX(20px) rotate(0deg);
  transition:
    opacity 0.3s ease,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s;
}
/* Plate palette — lifted straight from the pole's boards */
.site-nav .works-flyout a:nth-of-type(1) {
  --tilt: -1.7deg;
  background: #f6efa5; /* 关于 yellow lightbox */
  color: #191914;
}
.site-nav .works-flyout a:nth-of-type(2) {
  --tilt: 1.3deg;
  background: #fbf8f0; /* paper plate */
  color: #191914;
}
.site-nav .works-flyout a:nth-of-type(3) {
  --tilt: -1.1deg;
  background: var(--accent-blue); /* 作品 blue board */
  color: #f7f9ff;
}
.site-nav .works-flyout a:nth-of-type(4) {
  --tilt: 1.9deg;
  background: #161615; /* 联系 dark screen */
  color: #f5f2ea;
}
.site-nav .works-flyout a:hover {
  transform: translateX(-4px) rotate(0deg) !important;
  box-shadow: 4px 5px 0 #0b0b0a33;
}
.works-flyout__idx {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.site-nav .works-flyout a:nth-of-type(3) .works-flyout__idx,
.site-nav .works-flyout a:nth-of-type(4) .works-flyout__idx {
  color: #ffd968; /* warm signal-light yellow on dark plates */
}
.works-flyout__txt {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.works-flyout__txt em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
}
.works-flyout__arrow {
  flex: none;
  align-self: center;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.22s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-nav .works-flyout a:hover .works-flyout__arrow {
  opacity: 1;
  transform: translate(0, 0);
}

@media (hover: hover) and (pointer: fine) {
  /* Invisible bridge keeps hover alive across the gap (exists only while open) */
  .nav-works:hover::before,
  .nav-works:focus-within::before {
    content: "";
    position: absolute;
    top: -16px;
    bottom: -16px;
    right: 0;
    width: calc(100% + 32px);
  }
  .nav-works:hover .works-flyout,
  .nav-works:focus-within .works-flyout {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }
  .nav-works:hover .works-flyout a,
  .nav-works:focus-within .works-flyout a {
    opacity: 1;
    transform: translateX(0) rotate(var(--tilt));
    transition-delay: calc(var(--i) * 60ms + 40ms);
  }
  .nav-works:hover .works-flyout a:hover,
  .nav-works:focus-within .works-flyout a:hover {
    transition-delay: 0s;
  }
}

/* Filtered category with no works yet */
.projects-empty {
  align-self: center;
  margin: 9vh auto;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

@media (prefers-reduced-motion: reduce) {
  .works-flyout,
  .site-nav .works-flyout a,
  .works-flyout__arrow {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }
}

/* Back circle */
.back-circle {
  appearance: none;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  width: clamp(38px, 3.1vw, 46px);
  height: clamp(38px, 3.1vw, 46px);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s, transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  z-index: 90;
}
.back-circle:hover {
  background: #000;
  transform: scale(0.94);
}
.back-circle svg {
  width: 58%;
  height: 58%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}

/* Pages */
.page {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  z-index: 3;
}
.page.is-active {
  opacity: 1;
}
/* Only non-home pages capture input; home lets events reach the pole */
.page.is-active:not(.page--home) {
  pointer-events: auto;
}

.page-shell {
  height: 100svh;
  padding: var(--ui-gutter-y) var(--ui-edge-x);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

/* HOME */
.page--home {
  color: var(--ink);
  background: transparent;
}
.hero-section {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--ui-gutter-y) var(--ui-edge-x);
  position: relative;
}
.home-profile {
  width: min(max(360px, 24vw), calc(100vw - clamp(28px, 5.2vw, 88px)));
  padding-top: 4px;
}
.home-profile p {
  color: var(--ink-soft);
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin: 0 0 10px;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
  font-weight: 500;
  line-height: 1;
}
.home-profile h1 {
  margin: 0;
  font-size: max(32px, 3.6vw);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.home-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: end;
  gap: clamp(12px, 2vw, 28px);
  width: min(720px, calc(100vw - clamp(28px, 5.2vw, 88px)));
  margin: 0 0 clamp(8px, 2vh, 20px);
  padding: 0;
  display: grid;
}
.home-meta div {
  border-top: 1px solid var(--ink-line);
  padding-top: 10px;
}
.home-meta dt,
.home-meta dd {
  letter-spacing: 0.018em;
  text-transform: uppercase;
  margin: 0;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
  line-height: 1.25;
}
.home-meta dt { color: var(--ink-mute); }
.home-meta dd { color: var(--ink); margin-top: 7px; }

/* PROJECTS */
.page--projects {
  background: var(--projects-bg);
  color: var(--ink);
  overflow: hidden;
}
.projects-layout {
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: var(--ui-gutter-y) 0;
  gap: clamp(12px, 2vh, 28px);
}
.projects-header {
  padding: 0 var(--ui-edge-x);
  display: flex;
  align-items: center;
  gap: 24px;
}
.projects-intro {
  padding: 0 var(--ui-edge-x);
  width: min(max(520px, 340px + 12vw), 100%);
  margin-top: clamp(24px, 4vh, 48px);
}
.projects-intro p {
  color: var(--ink-soft);
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin: 0 0 12px;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
  line-height: 1;
}
.projects-intro h1 {
  margin: 0;
  font-size: max(22px, min(2.4vw, calc(23.4px + 0.84vw)));
  font-weight: 500;
  line-height: 1.12;
  max-width: 18ch;
}
.projects-marquee {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  touch-action: pan-y;
  cursor: default;
}
.projects-track {
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 1.6vw, 28px);
  height: 100%;
  padding: 0 var(--ui-edge-x) clamp(24px, 4vh, 48px);
  width: max-content;
  will-change: transform;
  /* JS velocity marquee (auto + wheel speed); CSS only for reduced-motion */
  transform: translate3d(0, 0, 0);
}
@media (prefers-reduced-motion: reduce) {
  .projects-track {
    animation: marquee 80s linear infinite;
  }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.project-card {
  flex: 0 0 auto;
  position: relative;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, opacity;
}
.project-card:nth-child(8n+1) { width: clamp(280px, 28vw, 420px); height: clamp(200px, 28vw, 360px); }
.project-card:nth-child(8n+2) { width: clamp(220px, 22vw, 340px); height: clamp(260px, 36vw, 480px); }
.project-card:nth-child(8n+3) { width: clamp(320px, 34vw, 520px); height: clamp(220px, 30vw, 400px); }
.project-card:nth-child(8n+4) { width: clamp(190px, 20vw, 310px); height: clamp(270px, 38vw, 520px); }
.project-card:nth-child(8n+5) { width: clamp(360px, 40vw, 620px); height: clamp(270px, 36vw, 470px); }
.project-card:nth-child(8n+6) { width: clamp(260px, 26vw, 420px); height: clamp(300px, 42vw, 560px); }
.project-card:nth-child(8n+7) { width: clamp(340px, 36vw, 560px); height: clamp(250px, 34vw, 450px); }
.project-card:nth-child(8n+8) { width: clamp(220px, 24vw, 360px); height: clamp(280px, 40vw, 540px); }
.project-card:hover { transform: translateY(-8px); }
.project-card__figure {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #e9e6df;
  overflow: hidden;
  position: relative;
}
.project-card__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.62s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project-card:hover .project-card__figure img { transform: scale(1.08); }
.project-card__name {
  position: absolute;
  top: -44px;
  left: 0;
  opacity: 0;
  transform: translateY(8px);
  font-size: max(14px, min(0.933vw, calc(9.1px + 0.33vw)));
  font-weight: 500;
  transition: opacity 0.18s, transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}
.project-card__meta {
  position: absolute;
  top: -24px;
  left: 0;
  opacity: 0;
  transform: translateY(8px);
  color: #0b0b0a85;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  font-size: max(11px, min(0.733vw, calc(7.15px + 0.26vw)));
  transition: opacity 0.18s, transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project-card:hover .project-card__name,
.project-card:hover .project-card__meta {
  opacity: 1;
  transform: translateY(0);
}

/* Project zoom overlay — GSAP handles fade; class toggles layout */
.project-zoom {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #fff;
  display: none;
  grid-template-columns: minmax(280px, max(420px, calc(273px + 11.4vw))) minmax(0, 980px);
  justify-content: center;
  align-items: center;
  gap: clamp(18px, 4vw, 72px);
  padding: var(--ui-gutter-y) var(--ui-edge-x);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.project-zoom.is-open {
  display: grid;
  pointer-events: auto;
  visibility: visible;
}
.project-zoom__header {
  position: absolute;
  top: var(--ui-gutter-y);
  left: var(--ui-edge-x);
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 2;
}
.project-zoom__image {
  aspect-ratio: 16 / 10;
  background: #e9e6df;
  width: min(100%, 62vw, 980px);
  max-height: calc(100svh - 96px);
  overflow: hidden;
  justify-self: end;
}
.project-zoom__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  will-change: transform;
}
.project-zoom__content {
  max-width: max(420px, calc(273px + 11.4vw));
}
.project-zoom__content > span {
  color: var(--ink-mid);
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin-bottom: 18px;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
  display: block;
}
.project-zoom__content h2 {
  margin: 0;
  font-size: max(36px, min(5.5vw, calc(54.6px + 1.9vw)));
  font-weight: 500;
  line-height: 0.88;
}
.project-zoom__content p {
  color: #0b0b0aad;
  margin: clamp(18px, 3vw, 34px) 0 0;
  font-size: max(15px, min(1.4vw, calc(11.7px + 0.49vw)));
  line-height: 1.55;
}
.project-zoom__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: clamp(22px, 4vw, 42px) 0 0;
}
.project-zoom__meta div {
  border-top: 1px solid #0b0b0a2e;
  padding-top: 10px;
}
.project-zoom__meta dt {
  color: #0b0b0a70;
  letter-spacing: 0.018em;
  text-transform: uppercase;
  margin: 0;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
}
.project-zoom__meta dd {
  margin: 8px 0 0;
  letter-spacing: 0.018em;
  text-transform: uppercase;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
}
.project-zoom__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: clamp(18px, 3vw, 32px);
  padding: 0 18px;
  border: 1px solid #0b0b0a3d;
  border-radius: 999px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
  font-weight: 500;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}
.project-zoom__link:hover {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* ABOUT / CONTACT shared */
.page--about,
.page--contact {
  background: #faf8f3;
  color: var(--ink);
}
.page--about::before,
.page--contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 80% 10%, rgba(196, 92, 38, 0.07), transparent 60%),
    radial-gradient(ellipse 40% 35% at 10% 90%, rgba(47, 93, 255, 0.06), transparent 55%);
  pointer-events: none;
}
.page-shell__header {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: clamp(38px, 3.1vw, 46px);
}
.lang-toggle {
  display: inline-flex;
  gap: 8px;
}
.lang-toggle button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink-mute);
  letter-spacing: 0.045em;
  text-transform: uppercase;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
  transition: color 0.18s;
}
.lang-toggle button.is-active,
.lang-toggle button:hover {
  color: var(--ink);
}
.about-content,
.contact-content {
  place-self: center;
  width: min(max(760px, calc(494px + 18.2vw)), 100%);
  margin-top: clamp(-48px, -4vh, -18px);
}
.page-shell__intro {
  text-align: center;
  width: min(max(680px, calc(442px + 16.3vw)), 100%);
  margin: 0 auto;
}
.page-shell__intro p {
  color: #0b0b0a7a;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin: 0 0 clamp(14px, 2vw, 22px);
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
  line-height: 1;
}
.page-shell__intro h1 {
  margin: 0;
  font-size: max(34px, min(5vw, calc(46.8px + 1.75vw)));
  font-weight: 500;
  line-height: 0.96;
  color: var(--ink);
}
.page--contact .page-shell__intro h1 {
  font-size: max(34px, min(5.2vw, calc(49.4px + 1.82vw)));
}
.about-body {
  border-top: 1px solid #0b0b0a24;
  width: min(max(620px, calc(403px + 16.3vw)), 100%);
  margin: clamp(28px, 5vh, 48px) auto 0;
  padding-top: clamp(16px, 2.4vw, 26px);
}
.about-body > p {
  color: #0b0b0aad;
  margin: 0;
  font-size: max(15px, min(1.35vw, calc(12px + 0.45vw)));
  line-height: 1.65;
  text-align: center;
}
.about-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  margin-top: clamp(28px, 4vh, 42px);
  width: 100%;
  max-width: min(100%, 720px);
  margin-left: auto;
  margin-right: auto;
}
/* Never force 5 skinny columns — long email + phone were overlapping */
.about-meta--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) {
  .about-meta--wide {
    /* row1: 姓名 学校 专业 | row2: 邮箱 手机 (span layout) */
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .about-meta--wide > div:nth-child(1),
  .about-meta--wide > div:nth-child(2),
  .about-meta--wide > div:nth-child(3) {
    grid-column: span 2;
  }
  .about-meta--wide > div:nth-child(4),
  .about-meta--wide > div:nth-child(5) {
    grid-column: span 3;
  }
}
.about-meta div {
  border-top: 1px solid #0b0b0a2e;
  padding-top: 10px;
  min-width: 0; /* allow grid shrink so text wraps instead of overflow */
}
.about-meta dt {
  color: var(--ink-mute);
  letter-spacing: 0.018em;
  text-transform: uppercase;
  margin: 0;
  font-size: max(12px, min(0.8vw, calc(7.8px + 0.28vw)));
}
.about-meta dd {
  margin: 8px 0 0;
  font-size: max(13px, min(0.9vw, calc(8.5px + 0.3vw)));
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.about-meta a {
  display: inline;
  max-width: 100%;
  transition: opacity 0.18s;
}
.about-meta a .inline-arrow {
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  vertical-align: -0.05em;
  margin-left: 2px;
}
.about-meta a:hover { opacity: 0.65; }
.about-meta a + a { margin-left: 12px; }

.contact-body {
  border-top: 1px solid #0b0b0a24;
  width: min(max(720px, calc(480px + 18vw)), 100%);
  margin: clamp(28px, 5vh, 48px) auto 0;
  padding-top: clamp(18px, 3vw, 28px);
}
.contact-list {
  list-style: none;
  margin: 0 0 clamp(28px, 4vh, 40px);
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 32px;
  justify-items: center;
  text-align: center;
  width: min(100%, 520px);
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 640px) {
  .contact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 640px);
  }
}
.contact-list li {
  min-width: 0;
  width: 100%;
  padding: 0 8px;
  box-sizing: border-box;
}
.contact-list__label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.contact-list a,
.contact-list__value {
  display: block;
  font-size: max(15px, min(1.6vw, calc(14px + 0.4vw)));
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.contact-list a {
  transition: opacity 0.18s;
}
.contact-list a:hover {
  opacity: 0.65;
}
.contact-qr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 32px);
  width: min(100%, 520px);
  margin: 0 auto;
}
.contact-qr__card {
  margin: 0;
  text-align: center;
  background: #fff;
  border: 1px solid #0b0b0a14;
  border-radius: 16px;
  padding: 14px 14px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
}
.contact-qr__card img {
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto;
  background: #f5f2eb;
}
.contact-qr__card figcaption {
  margin-top: 12px;
  display: grid;
  gap: 4px;
}
.contact-qr__card strong {
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.contact-qr__card span {
  font-size: 12px;
  color: var(--ink-soft);
  word-break: break-all;
}
@media (max-width: 520px) {
  .contact-qr {
    grid-template-columns: 1fr;
    max-width: 260px;
  }
}
.contact-links {
  display: grid;
  gap: 14px;
  justify-items: center;
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: max(18px, min(2.2vw, calc(16px + 0.7vw)));
  font-weight: 500;
  line-height: 1.1;
  transition: transform 0.18s, opacity 0.18s;
}
.contact-links a:hover {
  transform: translateY(-1px);
  opacity: 0.7;
}
.inline-arrow {
  width: 0.72em;
  height: 0.72em;
  display: inline-block;
}

/* Mouse stalker — position driven by gsap.quickTo (x/y) */
.mouse-stalker {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 160;
  width: 18px;
  height: 18px;
  pointer-events: none;
  mix-blend-mode: normal;
  transition: width 0.22s ease, height 0.22s ease, opacity 0.2s;
  opacity: 0;
  will-change: transform;
}
.mouse-stalker.is-on { opacity: 1; }
.mouse-stalker.is-label {
  width: 88px;
  height: 32px;
}
.mouse-stalker__dot {
  width: 100%;
  height: 100%;
  background: var(--ink);
  border-radius: 2px;
}
.mouse-stalker.is-label .mouse-stalker__dot {
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #fff;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
}
@media (pointer: coarse) {
  .mouse-stalker { display: none; }
  body { cursor: auto; }
}
@media (pointer: fine) {
  body, a, button { cursor: none; }
}

/* Text reveal — GSAP drives motion; keep visible by default so nav never leaves blank content */
.reveal {
  opacity: 1;
  transform: none;
}
.reveal-d1, .reveal-d2, .reveal-d3, .reveal-d4, .reveal-d5 { }

/* Magnetic targets keep layout stable */
.back-circle,
.contact-qr__card,
.site-nav a {
  will-change: transform;
}
.contact-qr {
  perspective: 900px;
}
.contact-qr__card {
  transform-style: preserve-3d;
}

@media (prefers-reduced-motion: reduce) {
  .projects-track,
  .project-card,
  .back-circle,
  .contact-qr__card,
  .site-nav a,
  .mouse-stalker {
    will-change: auto;
  }
  .project-card:hover { transform: none; }
  .project-card:hover .project-card__figure img { transform: scale(1.02); }
}

/* Responsive */
@media (max-width: 960px) {
  .project-zoom {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 54svh) auto;
    align-items: end;
    gap: 18px;
    overflow: auto;
  }
  .project-zoom__image {
    justify-self: center;
    width: min(100%, 86.4svh);
    max-height: 54svh;
    margin-top: 44px;
  }
  .project-zoom__content {
    max-width: 640px;
  }
}
@media (max-width: 620px) {
  .home-meta {
    grid-template-columns: 1fr;
    gap: 10px;
    width: min(280px, 100%);
  }
  .home-meta div {
    border-top: 0;
    padding-top: 0;
  }
  .about-meta {
    grid-template-columns: 1fr;
  }
  .about-content .page-shell__intro,
  .contact-content .page-shell__intro {
    text-align: left;
  }
  .about-body > p {
    text-align: left;
  }
  .contact-content .page-shell__intro {
    text-align: center;
  }
  .project-zoom__meta {
    grid-template-columns: 1fr;
  }
}

/* ---------- BGM toggle — mini signal board, above sticker tray ---------- */
.bgm-toggle {
  position: fixed;
  right: var(--ui-edge-x);
  bottom: calc(clamp(18px, 3.2vh, 40px) + 64px);
  z-index: 90;
  width: 44px;
  height: 44px;
  padding: 0;
  appearance: none;
  border: 2px solid #161615;
  border-radius: 10px;
  background: #161615;
  box-shadow: 2.5px 3.5px 0 #0b0b0a2b;
  transform: rotate(-2deg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bgm-toggle__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}
.bgm-toggle__bars i {
  width: 2.5px;
  height: 14px;
  border-radius: 1px;
  background: #57544c;
  transform: scaleY(0.35);
  transform-origin: bottom;
  transition: background 0.25s ease, transform 0.25s ease;
}
.bgm-toggle__lamp {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #5a5648;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.bgm-toggle.is-playing .bgm-toggle__bars i {
  background: #f7f4ee;
  animation: bgm-bounce 0.9s ease-in-out infinite;
}
.bgm-toggle.is-playing .bgm-toggle__bars i:nth-child(1) { animation-delay: 0s; }
.bgm-toggle.is-playing .bgm-toggle__bars i:nth-child(2) { animation-delay: -0.24s; }
.bgm-toggle.is-playing .bgm-toggle__bars i:nth-child(3) { animation-delay: -0.48s; }
.bgm-toggle.is-playing .bgm-toggle__bars i:nth-child(4) { animation-delay: -0.66s; }
.bgm-toggle.is-playing .bgm-toggle__lamp {
  background: #f7c948;
  box-shadow: 0 0 6px #f7c948aa;
}
@keyframes bgm-bounce {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}
@media (pointer: fine) {
  .bgm-toggle:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 3px 4.5px 0 #0b0b0a2b;
  }
}
.bgm-toggle:active {
  transform: rotate(0deg) scale(0.94);
}
@media (prefers-reduced-motion: reduce) {
  .bgm-toggle {
    transition: none;
  }
  .bgm-toggle.is-playing .bgm-toggle__bars i {
    animation: none;
    transform: scaleY(0.75);
  }
}
