/* ═══════════════════════════════════════════════════════════
   LABORATORY 0 — nordic postmodern futurism
   bone / ink / ultramarine signal
   ═══════════════════════════════════════════════════════════ */

:root {
  --bone: #eae7e0;
  --bone-dim: #ddd9d0;
  --ink: #101010;
  --ink-soft: rgba(16, 16, 16, 0.55);
  --signal: #3425ff;
  --void: #0b0b0d;
  --void-line: rgba(234, 231, 224, 0.16);
  --line: rgba(16, 16, 16, 0.18);
  --font-display: "Syne", sans-serif;
  --font-mono: "Space Mono", monospace;
  --font-serif: "Instrument Serif", serif;
  --pad: clamp(1.25rem, 4vw, 4rem);
  --head-h: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  overflow-x: hidden;
  cursor: none;
}

@media (pointer: coarse), (max-width: 900px) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

::selection { background: var(--signal); color: var(--bone); }

.mono {
  font-family: var(--font-mono);
  font-size: clamp(0.56rem, 1vw, 0.7rem);
  letter-spacing: 0.14em;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, .track:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

/* ═══════════ GRAIN ═══════════ */

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(4) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.4%); }
  50% { transform: translate(1.6%, -1%); }
  75% { transform: translate(-1%, -1.8%); }
  100% { transform: translate(0, 0); }
}

/* ═══════════ PRELOADER ═══════════ */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--ink);
  color: var(--bone);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--pad);
  transition: transform 0.9s cubic-bezier(0.83, 0, 0.17, 1);
}
body.loaded .preloader {
  transform: translateY(-100%);
  pointer-events: none;
}
.pre-grid { display: flex; justify-content: space-between; }
.pre-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  opacity: 0.6;
}
.pre-center {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1rem;
}
.pre-zero {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(6rem, 24vw, 18rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px var(--bone);
  animation: preZeroPulse 1.6s ease-in-out infinite;
}
@keyframes preZeroPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.pre-count {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: var(--signal);
  filter: brightness(1.6);
}
.pre-bar {
  height: 1px;
  background: rgba(234, 231, 224, 0.2);
  overflow: hidden;
}
.pre-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--bone);
  transition: width 0.2s linear;
}

/* ═══════════ CURSOR ═══════════ */

.cursor {
  position: fixed;
  inset: 0;
  z-index: 2500;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
/* 指针进入 iframe（YouTube 等）后主页面收不到 mousemove，隐藏避免“冻结”在边框 */
.cursor.is-hidden { opacity: 0; }
.cursor-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--signal);
  border-radius: 50%;
}
.cursor-ring {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid var(--signal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              margin 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.35s ease;
}
.cursor-label { display: none; }
/* 悬停交互元素：环收缩为实心小圆点 */
.cursor.is-hover .cursor-ring {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--signal);
}
.cursor.is-hover .cursor-dot { opacity: 0; }

/* ═══════════ HEADER ═══════════ */

.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1500;
  height: var(--head-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* 中列绝对居中，不受两侧宽度影响 */
  align-items: center;
  padding: 0 var(--pad);
  mix-blend-mode: difference;
  color: #fff;
}
.head-mark { justify-self: start; }
.head-meta { justify-self: center; }
.head-nav { justify-self: end; }
.head-mark {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.head-meta {
  display: flex;
  gap: 2rem;
  opacity: 0.7;
}
.head-nav { display: flex; gap: clamp(1rem, 3vw, 2.5rem); }
.head-nav a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  position: relative;
  padding-bottom: 2px;
}
.head-nav a sup { margin-right: 0.35em; opacity: 0.5; }
.head-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.head-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ═══════════ HERO ═══════════ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--head-h) + 1rem) var(--pad) clamp(2rem, 5vh, 4rem);
  overflow: hidden;
}
.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-eyebrow {
  position: relative;
  color: var(--ink-soft);
  margin-top: auto; /* 与 hero-foot 的 auto 平分剩余空间 → 标题组垂直居中 */
  margin-bottom: clamp(1rem, 3vh, 2.5rem);
}
.hero-title {
  position: relative;
  font-weight: 800;
  font-size: clamp(1.3rem, 7vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ht-zero { color: var(--signal); }
.ht-dial {
  flex: 0 0 auto;
  width: clamp(4rem, 7vw, 6rem);
  height: clamp(4rem, 7vw, 6rem);
}
.dial-svg {
  width: 100%;
  height: 100%;
  animation: dialSpin 24s linear infinite;
}
@keyframes dialSpin { to { transform: rotate(360deg); } }
.dial-outer, .dial-inner {
  fill: none;
  stroke: var(--ink);
  stroke-width: 0.75;
  opacity: 0.5;
}
.dial-inner { stroke: var(--signal); opacity: 1; stroke-dasharray: 4 6; }
.dial-text {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.24em;
  fill: var(--ink);
}
.hero-foot {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* 表盘精确居中，两侧底对齐 */
  align-items: end;
  margin-top: auto;
  padding-top: clamp(1.5rem, 5vh, 3.5rem);
  gap: 1.5rem;
}
.hero-note { grid-column: 1; justify-self: start; }
.hero-foot .ht-dial { grid-column: 2; justify-self: center; }
.hero-scroll { grid-column: 3; justify-self: end; }
.hero-note { color: var(--ink-soft); line-height: 1.9; }
.hero-scroll { color: var(--ink); }
.hero-scroll .arrow {
  display: inline-block;
  animation: arrowNudge 1.8s ease-in-out infinite;
}
@keyframes arrowNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* reveal-on-load lines */
.reveal-line { display: block; overflow: hidden; }
.reveal-line .reveal-inner {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
body.loaded .reveal-line .reveal-inner { transform: translateY(0); }
.hero-eyebrow .reveal-inner { transition-delay: 0.15s; }
.hero-title .reveal-inner { transition-delay: 0.3s; }
.hero-foot .reveal-inner { transition-delay: 0.55s; }

/* ═══════════ SECTIONS ═══════════ */

.section {
  position: relative;
  padding: clamp(4rem, 10vh, 8rem) var(--pad);
}
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem clamp(1rem, 4vw, 3rem);
  align-items: baseline;
  margin-bottom: clamp(3rem, 8vh, 6rem);
}
.sec-index {
  color: var(--signal);
  font-size: clamp(0.7rem, 1.4vw, 1rem);
}
.sec-title {
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.st-outline {
  color: transparent;
  -webkit-text-stroke: clamp(1px, 0.14vw, 2px) currentColor;
}
.section--music .st-outline { -webkit-text-stroke-color: var(--bone); }
.section--design .st-outline, .section--about .st-outline { -webkit-text-stroke-color: var(--ink); }
.sec-blurb {
  grid-column: 2;
  max-width: 34rem;
  line-height: 2;
  color: var(--ink-soft);
}

/* ═══════════ MEDIA SLOTS (embed placeholders) ═══════════ */

.media-slot {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bone-dim);
}
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-21x9 { aspect-ratio: 21 / 9; }
.ratio-4x5  { aspect-ratio: 4 / 5; }
.ratio-3x4  { aspect-ratio: 3 / 4; }
.ratio-1x1  { aspect-ratio: 1 / 1; }
.media-slot--player { min-height: 152px; aspect-ratio: auto; }

/* 放入真实媒体后自动铺满 */
.media-slot img,
.media-slot video,
.media-slot iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(-45deg,
      transparent 0 14px,
      rgba(16, 16, 16, 0.045) 14px 15px);
}
.media-slot--dark { background: #131316; }
.media-slot--dark .media-placeholder {
  border-color: var(--void-line);
  background:
    repeating-linear-gradient(-45deg,
      transparent 0 14px,
      rgba(234, 231, 224, 0.05) 14px 15px);
}
.ph-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--signal);
}
.media-slot--dark .ph-label { filter: brightness(1.8); }
.ph-note {
  color: var(--ink-soft);
  animation: phBlink 2.4s ease-in-out infinite;
}
.media-slot--dark .ph-note { color: rgba(234, 231, 224, 0.45); }
@keyframes phBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.ph-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--signal);
}
.ph-tl { top: 8px; left: 8px; border-top-width: 1.5px; border-left-width: 1.5px; }
.ph-tr { top: 8px; right: 8px; border-top-width: 1.5px; border-right-width: 1.5px; }
.ph-bl { bottom: 8px; left: 8px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.ph-br { bottom: 8px; right: 8px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* ═══════════ 01 DESIGN — projects ═══════════ */

.section--design { border-top: 1px solid var(--line); } /* 取代跑马灯的分界线 */

.projects {
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 12vh, 9rem);
}
.project {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem clamp(1rem, 3vw, 2.5rem);
  align-items: start; /* 媒体与文字顶对齐，避免一侧悬空 */
}
.project-media {
  grid-column: 1 / 9;
  position: relative;
}
.project--right .project-media { grid-column: 5 / 13; order: 2; }
.project--right .project-info { order: 1; text-align: right; grid-column: 1 / 5; }
.project-media--small { grid-column: 1 / 7; }
.project--full .project-media { grid-column: 1 / 13; }
.project--full .project-info { grid-column: 1 / 13; display: flex; align-items: baseline; gap: 2rem; flex-wrap: wrap; }
.project--full .project-title { font-size: clamp(1.4rem, 3.4vw, 2.6rem); }

.project-media .media-slot {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-media:hover .media-slot { transform: scale(0.985); }
.project-media:hover .media-placeholder { animation: slotGlitch 0.5s steps(2) 1; }
@keyframes slotGlitch {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-4px, 2px); }
  50% { transform: translate(3px, -3px); }
  75% { transform: translate(-2px, -1px); }
  100% { transform: translate(0, 0); }
}

.project-info { grid-column: 9 / 13; }
.project-num {
  display: block;
  color: var(--signal);
  margin-bottom: 0.9rem;
}
.project-title {
  font-weight: 700;
  font-size: clamp(1.5rem, 3.6vw, 2.8rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.project-title em { font-size: 1.05em; }
.project-tags {
  margin-top: 0.9rem;
  color: var(--ink-soft);
}

/* ═══════════ 02 MUSIC (dark) ═══════════ */

.section--music {
  background: var(--void);
  color: var(--bone);
}
.section--music .sec-blurb,
.section--music .project-tags { color: rgba(234, 231, 224, 0.5); }
.section--music .ph-note { color: rgba(234, 231, 224, 0.45); }
.section--music .media-placeholder { border-color: var(--void-line); }

.wave-canvas {
  width: 100%;
  height: 110px;
  display: block;
  margin-bottom: clamp(3rem, 7vh, 5rem);
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(2.5rem, 6vh, 4rem) clamp(1rem, 3vw, 2.5rem);
}
.tracklist { grid-column: 1 / 9; display: flex; flex-direction: column; }
.music-side {
  grid-column: 9 / 13;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vh, 4rem);
}
.music-side .project-info { margin-top: 1.1rem; }
.project-title--sm { font-size: clamp(1rem, 1.5vw, 1.25rem); }

.tl-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--void-line);
}
.tl-art {
  width: clamp(3.5rem, 6vw, 5rem);
  height: clamp(3.5rem, 6vw, 5rem);
  object-fit: cover;
  display: block;
}
.tl-head-txt { display: flex; flex-direction: column; gap: 0.5rem; }
.tracklist-head { color: var(--bone); }
.tl-sub { color: rgba(234, 231, 224, 0.4); }

.track {
  display: block;
  padding: 1.15rem 0.25rem 1rem;
  border-bottom: 1px solid var(--void-line);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.track-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.track-num { color: var(--signal); filter: brightness(1.8); }
.track-state { flex: 0 0 auto; color: rgba(234, 231, 224, 0.55); font-size: 0.62rem; }
.track-name {
  font-weight: 700;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  letter-spacing: 0.05em;
  flex: 1;
  transition: color 0.3s ease;
}
.track:hover .track-name,
.track.is-playing .track-name { color: #fff; }
.track.is-playing .track-state { color: var(--signal); filter: brightness(1.8); }
.track-len { opacity: 0.55; }
.track-wave {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: 0.85rem;
  touch-action: none; /* 允许指针拖动 scrub，不触发页面滚动 */
}
.track--soon { opacity: 0.35; cursor: default; }
.track.is-loading .track-state {
  color: var(--signal);
  filter: brightness(1.8);
  animation: phBlink 1s ease-in-out infinite; /* 等解码定位时呼吸提示 */
}

/* ═══════════ 03 ABOUT ═══════════ */

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3rem clamp(1rem, 3vw, 2.5rem);
  align-items: start;
}
.about-statement { grid-column: 1 / 13; }

.statement {
  font-weight: 700;
  /* 全句 48.5em 宽，容器 ~90vw → 1.8vw 保证任何桌面宽度都单行 */
  font-size: 1.8vw;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.statement em { color: var(--signal); font-size: 1.1em; }

.about-mail {
  display: inline-block;
  margin-top: clamp(1.75rem, 4vh, 2.5rem);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.3vw, 1.05rem);
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.25em;
  transition: color 0.3s ease, border-color 0.3s ease;
  overflow-wrap: anywhere;
}
.about-mail:hover { color: var(--signal); border-color: var(--signal); }
.mail-arrow { display: inline-block; margin-left: 0.3em; transition: transform 0.3s ease; }
.about-mail:hover .mail-arrow { transform: translate(4px, -4px); }

.portrait-caption {
  display: block;
  margin-top: 0.8rem;
  color: var(--ink-soft);
}

/* ═══════════ FOOTER ═══════════ */

.site-foot {
  background: var(--ink);
  color: var(--bone);
  padding: clamp(3rem, 8vh, 5rem) var(--pad) clamp(1.5rem, 4vh, 2.5rem);
  overflow: hidden;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin-bottom: clamp(2.5rem, 7vh, 5rem);
}
.foot-links a {
  position: relative;
  opacity: 0.65;
  transition: opacity 0.3s ease;
}
.foot-links a:hover { opacity: 1; }
.foot-mark {
  font-weight: 800;
  font-size: clamp(1.9rem, 7.5vw, 8.5rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(234, 231, 224, 0.55);
  white-space: nowrap;
  transition: color 0.6s ease;
}
.foot-mark:hover { color: rgba(234, 231, 224, 0.12); }
.foot-zero { color: var(--signal); -webkit-text-stroke: 0; filter: brightness(1.5); margin-left: 0.06em; }
.foot-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: clamp(2rem, 5vh, 3.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgba(234, 231, 224, 0.16);
  opacity: 0.6;
}

/* ═══════════ SUB-HEADS ═══════════ */

.sub-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  color: var(--ink);
}
.sub-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
}
.sub-key {
  color: var(--signal);
  font-weight: 700;
}

/* ═══════════ PROJECT DESC + LINK ═══════════ */

.project-desc {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.85em;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink-soft);
  font-weight: 500;
  max-width: 44ch;
  text-align: left;
}
.section--music .project-desc { color: rgba(234, 231, 224, 0.55); }
.project--right .project-desc { margin-left: auto; }

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin-top: 1.6rem;
  padding: 0.85em 1.5em;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.project-link:hover { background: var(--ink); color: var(--bone); }

/* ═══════════ MORPH-6 SPECIMEN INDEX ═══════════ */

.algo {
  margin-top: 1.6rem;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 0.88rem; /* 与 project-desc 同字号，使 44ch 完全同宽 */
  max-width: 44ch;
}
.project--right .algo { margin-left: auto; }
.algo summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--signal);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.algo summary::-webkit-details-marker { display: none; }
.algo summary::after {
  content: "+";
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.3s ease;
}
.algo[open] summary::after { transform: rotate(45deg); }
.algo-item {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.4rem 1rem;
  padding: 0.9rem 0.25rem;
  border-top: 1px dashed var(--line);
}
.algo-item b {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding-top: 0.2em;
}
.algo-item p {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ═══════════ GRAPHIC GALLERY ═══════════ */

/* 列宽 = 各图宽高比 → 单行等高，整段收进一屏 */
.gallery {
  display: grid;
  grid-template-columns: 1.793fr 1fr 1.533fr;
  gap: clamp(0.75rem, 2vw, 2rem);
  align-items: start;
}
.g-item {
  margin: 0;
  overflow: hidden;
}
.g-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.g-item:hover img { transform: scale(1.015); }
.g-item figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: clamp(0.56rem, 1vw, 0.66rem);
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.recent-note {
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 2;
}
.recent-note b { color: var(--signal); font-weight: 400; }

/* ═══════════ TEXT LINKS ═══════════ */

.tx-link {
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.1em;
  transition: color 0.25s ease;
}
.tx-link:hover { color: var(--signal); }
.section--music .tx-link:hover { color: #8d7dff; }

/* dark 区的 details 适配 */
.section--music .algo { border-color: var(--void-line); }
.section--music .algo summary { color: #8d7dff; }
.session-notes {
  display: grid;
  gap: 0.8em;
  padding: 0.25rem 0.25rem 1rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: rgba(234, 231, 224, 0.55);
  font-weight: 500;
  text-align: left;
}

.music-quote {
  margin-top: 2.25rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.55;
  color: rgba(234, 231, 224, 0.75);
}

/* ═══════════ CREDITS ═══════════ */

.credits {
  grid-column: 1 / -1;
  margin-top: clamp(1rem, 4vh, 2.5rem);
}
.credits-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: rgba(234, 231, 224, 0.5);
  margin-bottom: 0.6rem;
}
.credits-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--void-line);
}
.credit {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.05rem 0.25rem;
  border-bottom: 1px solid var(--void-line);
}
.credit-tag {
  flex: 0 0 6.5rem;
  color: var(--signal);
  filter: brightness(1.8);
}
.credit-body {
  flex: 1;
  font-weight: 700;
  font-size: clamp(0.78rem, 1.3vw, 0.95rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.credit-note {
  font-weight: 500;
  color: rgba(234, 231, 224, 0.5);
}

/* ═══════════ ABOUT EXTRAS ═══════════ */

.about-body {
  margin-top: clamp(1.75rem, 5vh, 3rem);
  display: grid;
  gap: 1.4em;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink-soft);
  font-weight: 500;
  /* 左锚点通栏，与全站正文阅读流一致；每段约两行 */
}

/* ═══════════ SCROLL REVEAL ═══════════ */

.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.9s ease, transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════ MOBILE ═══════════ */

@media (max-width: 900px) {
  .head-meta { display: none; }


  .project,
  .music-grid,
  .about-grid { display: flex; flex-direction: column; align-items: stretch; }

  .project--right .project-media { order: 0; }
  .project--right .project-info { order: 1; text-align: left; align-self: stretch; }
  .project-info { margin-top: 0.25rem; }

  .sec-head { grid-template-columns: 1fr; }
  .sec-blurb { grid-column: 1; }

  .ratio-21x9 { aspect-ratio: 16 / 9; }
  .wave-canvas { height: 70px; }

  .project--right .project-desc { margin-left: 0; }
  .credit { flex-wrap: wrap; gap: 0.35rem 1rem; }
  .credit-tag { flex-basis: 100%; }
  .project-desc { max-width: none; }
  .about-body { grid-template-columns: 1fr; }

  .foot-mark { font-size: clamp(1.4rem, 7vw, 4rem); }
}

@media (max-width: 600px) {
  :root { --head-h: 3.75rem; }
  .sec-title { font-size: clamp(1.8rem, 9.5vw, 3.5rem); }
  .ht-dial { width: clamp(2.8rem, 12vw, 3.4rem); height: clamp(2.8rem, 12vw, 3.4rem); }
  .site-head { flex-wrap: nowrap; }
  .head-mark { font-size: 0.9rem; }
  .head-nav { gap: 0.9rem; }
  .head-nav a { font-size: 0.55rem; }
  .head-nav a sup { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .algo-item { grid-template-columns: 1fr; gap: 0.3rem; }
  .hero-foot { grid-template-columns: 1fr auto; }
  .hero-note { grid-column: 1 / -1; }
  .hero-foot .ht-dial { grid-column: 1; justify-self: start; }
  .hero-scroll { grid-column: 2; align-self: center; }
  /* 窄屏物理放不下整句，允许换行并恢复可读字号 */
  .statement { white-space: normal; font-size: clamp(1.1rem, 5.2vw, 1.5rem); }
}

/* ═══════════ REDUCED MOTION ═══════════ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .dial-svg, .ph-note,
  .hero-scroll .arrow, .pre-zero { animation: none !important; }
  .reveal, .reveal-line .reveal-inner { transition: none !important; transform: none !important; opacity: 1 !important; }
}
