/* ═══════ VARIABLES ═══════ */
:root {
  --bg: #f0ece6;
  --ink: #2c2926;
  --ink-soft: #5a5550;
  --ink-mute: #9b9490;
  --rose: #c4908a;
  --gold: #b8a07a;
  --sage: #a0b0a0;
  --slate: #8a96a0;
  --serif: 'Cormorant Garamond', 'Noto Serif SC', serif;
  --sans: 'DM Sans', 'Noto Serif SC', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═══════ RESET ═══════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }

/* ═══════ INTRO ═══════ */
.intro {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg);
  cursor: pointer;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.intro.gone {
  opacity: 0; transform: scale(1.05);
  pointer-events: none;
}
.intro-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 500; font-style: italic;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.intro-cn {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}
.intro-hint {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-top: 3rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ═══════ SITE ═══════ */
.site {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  opacity: 0;
  transition: opacity 0.6s 0.4s;
}
.site.visible { opacity: 1; }

/* ═══════ NAV (GSAP MENU) ═══════ */
.mn {
  position: fixed; inset: 0 0 auto 0;
  z-index: 900;
}

.mn-top {
  z-index: 2;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 1.15rem;
  position: relative;
}

.mn-bar {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
  position: relative;
}

.mn-logo,
.mn-contact {
  font-family: 'Inconsolata', monospace;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-shadow: 0 1em 0 var(--ink);
}
.mn-logo > *, .mn-contact > * { will-change: transform; }

.mn-menu {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, 25%);
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: stretch;
  width: 1.5rem; height: 0.85rem;
  cursor: pointer;
}

.mn-menu-line {
  background: var(--ink);
  width: 100%; height: 3.5px;
  clip-path: inset(1px 0 1px 0);
  will-change: transform;
}
.mn-menu-line.top { position: absolute; top: 0; }
.mn-menu-line.bottom { position: absolute; bottom: 0; }

.mn-top-line {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; height: 3px;
  background: var(--ink-mute);
  clip-path: inset(1px 0 1.15px 0);
}

/* ── dropdown ── */
.mn-drop {
  position: fixed; inset: 0;
  z-index: 1;
  background: #fff9eee6;
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: stretch;
  padding-top: 3.5rem; padding-bottom: 0;
  will-change: clip-path;
}

.mn-drop-row {
  flex: 1;
  display: flex; justify-content: center; align-items: center;
  gap: 3vw;
  width: 100%;
  position: relative;
}

.mn-link-wrap {
  padding: 1vh 3vh;
  position: relative;
  overflow: hidden;
}

.mn-link {
  color: #1e1d1a;
  font-family: 'Spectral', var(--serif);
  font-size: clamp(2.5rem, 12vh, 8rem);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1em 0 #cb9f4d;
}
.mn-link > * { will-change: transform; }

.mn-link::before {
  content: attr(nav-number);
  font-size: 0.14em;
  position: absolute;
  top: 0.6em;
  text-shadow: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  font-family: 'Inconsolata', monospace;
  font-weight: 400;
  color: #cb9f4d;
}
.mn-drop-row:nth-child(odd) .mn-link::before { right: -1.4em; }
.mn-drop-row:nth-child(even) .mn-link::before { left: -1.4em; }
.mn-link.fade-in::before { opacity: 1; }

.mn-link-img-wrap {
  aspect-ratio: 3 / 2;
  flex: none;
  width: 17.5vh;
  position: relative;
  overflow: hidden;
}
.mn-ph {
  width: 100%; height: 100%;
  background: #111;
}

.mn-drop-line {
  width: 100%; height: 3px;
  background: #999;
  clip-path: inset(1px 0 1.15px 0);
  will-change: clip-path;
}

@media screen and (max-width: 640px) {
  .mn-link-img-wrap { display: none; }
}

/* ═══════ SCROLL DOTS ═══════ */
.scroll-dots {
  position: fixed; right: 1.6rem; top: 50%;
  transform: translateY(-50%);
  z-index: 800;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.scroll-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-mute);
  opacity: 0.3;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
}
.scroll-dot:hover { opacity: 0.6; transform: scale(1.3); }
.scroll-dot.active {
  opacity: 1; background: var(--ink);
  transform: scale(1.4);
}

/* ═══════ PAGE BASE ═══════ */
.page {
  min-height: 100vh;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 4rem 4rem;
  overflow: hidden;
}

.page-num {
  position: absolute;
  bottom: 2rem; left: 3rem;
  font-family: var(--serif);
  font-size: 5rem;
  font-weight: 300; font-style: italic;
  color: var(--ink);
  opacity: 0.04;
  line-height: 1;
}

.page-inner {
  display: flex;
  gap: 4rem;
  max-width: 1100px;
  width: 100%;
  align-items: center;
}
.page-inner--left { flex-direction: row; }
.page-inner--right { flex-direction: row-reverse; }

.page-text {
  flex: 1; min-width: 0;
}
.page-text h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500; font-style: italic;
  color: var(--ink);
  margin-bottom: 1.2rem;
  line-height: 1.2;
}
.page-text h2 .h2-sub {
  font-size: 0.55em;
  font-weight: 400;
  color: var(--ink-soft);
}
.page-text h3 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600; font-style: italic;
  color: var(--ink);
  margin: 1rem 0 0.3rem;
}
.page-text p {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.7;
}
.part-label {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-bottom: 0.8rem;
}
.part-caption {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--ink-mute);
  margin-top: 0.8rem;
}
.part-caption a {
  color: var(--rose);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── page image ── */
.page-img {
  flex: 0 0 42%;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}
.page-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(0px) saturate(1);
  transition: filter 0.5s var(--ease), transform 0.5s var(--ease);
}
.frost-img:hover img {
  filter: blur(14px) saturate(0.6);
}

/* ── page orb ── */
.page-orb {
  position: absolute;
  width: clamp(250px, 30vw, 500px);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.12;
  filter: blur(80px);
  pointer-events: none;
}
.page-orb--rose { background: var(--rose); }
.page-orb--gold { background: var(--gold); }
.page-orb--sage { background: var(--sage); }
.page-orb--slate { background: var(--slate); }

/* ── reveal ── */
.page-text, .page-img {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.page-img { transition-delay: 0.15s; }
.page.in-view .page-text,
.page.in-view .page-img {
  opacity: 1; transform: translateY(0);
}

/* ═══════ ABOUT PAGE ═══════ */
.about-layout {
  width: 100%;
  max-width: 1100px;
  display: flex; flex-direction: column;
  align-items: center;
}
.about-top {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  width: 100%;
  padding-left: 2vw;
}
.about-top .page-text {
  padding-top: 1rem;
}

/* lanyard */
.lanyard {
  flex: 0 0 240px;
  height: 360px;
  position: relative;
  perspective: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lanyard-strap {
  width: 120px; height: 200px;
  position: absolute; top: 0;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.badge {
  position: absolute;
  top: 150px;
  width: 200px; height: 260px;
  transform-style: preserve-3d;
  transform-origin: 50% -30px;
  transition: transform 0.1s linear;
  z-index: 2;
  cursor: grab;
}
.badge:active { cursor: grabbing; }

.badge-clip {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 22px;
  background: linear-gradient(135deg, #d4d0c8, #b0a898, #d4d0c8);
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.4);
  z-index: 3;
}
.badge-clip-ring {
  width: 10px; height: 10px;
  border: 2px solid #a09888;
  border-radius: 50%;
  margin: 3px auto 0;
}

.badge-body {
  width: 100%; height: 100%;
  border-radius: 14px;
  background: linear-gradient(160deg, #faf8f5 0%, #f0ece4 40%, #e8e0d8 100%);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.12),
    0 2px 8px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -1px 0 rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.6rem 1.2rem 1.2rem;
  overflow: hidden;
  position: relative;
}

.badge-gloss {
  position: absolute; inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%, rgba(0,0,0,0.02) 100%);
  pointer-events: none;
}

.badge-photo {
  width: 120px; height: 140px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--bg);
}
.badge-photo-ph {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--sage) 0%, var(--slate) 100%);
  opacity: 0.3;
}

.badge-name {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600; font-style: italic;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.badge-role {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}

/* text-type */
.text-type-line {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 500; font-style: italic;
  color: var(--ink);
  min-height: 1.3em;
  margin-bottom: 0.8rem;
}
.text-type-cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--ink);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.about-subtitle {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}
.about-body {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

/* ═══════ PROJECTS ═══════ */
.project-item {
  margin-bottom: 1.2rem;
}
.project-item a {
  display: block;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  border: 1.5px solid transparent;
  transition: all 0.3s var(--ease);
}
.project-item a:hover {
  background: rgba(255,255,255,0.5);
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}
.project-item h3 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600; font-style: italic;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.project-item p {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ═══════ SELF MEDIA ═══════ */
.sm-wrap {
  width: 100%;
  max-width: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: 1.2vh;
  padding: 0;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.page.in-view .sm-wrap {
  opacity: 1; transform: translateY(0);
}

/* 标题 + 头像 + 元信息：同一竖轴线居中 */
.sm-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0.9vh;
}
.sm-title {
  font-family: 'Spectral', var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  letter-spacing: 0.04em;
  margin: 0;
  width: 100%;
  text-align: center;
}

/* 仅简介卡限宽；标签与走马灯在 sm-wrap 下单独排，避免 580px 把全宽挤成右侧留白 */
.sm-content {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2vh;
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
  box-sizing: border-box;
}
.sm-content > .sm-bio {
  width: 100%;
}

#pg-selfmedia.page {
  overflow-x: hidden;
  overflow-y: hidden;
  padding-left: 0;
  padding-right: 0;
}
#pg-selfmedia .sm-hero {
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
  box-sizing: border-box;
}

/* 图集入口：仅在 Self Media 区块内 absolute */
.sm-gallery-entry {
  position: absolute;
  right: auto;
  bottom: auto;
  width: 112px;
  height: 112px;
  border-radius: 14px;
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: box-shadow 0.35s var(--ease);
  z-index: 5;
  touch-action: none;
  will-change: left, top;
  left: 5%;
  top: 22%;
}
.sm-gallery-entry.dragging {
  cursor: grabbing;
  transition: box-shadow 0.2s var(--ease);
  box-shadow: 0 10px 36px rgba(0,0,0,0.16);
}
.sm-gallery-entry:hover:not(.dragging) {
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}
.sm-gallery-entry:hover:not(.dragging) .sm-gallery-thumb {
  transform: scale(1.04);
}
.sm-gallery-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s var(--ease);
  pointer-events: none;
}
.sm-gallery-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0.3rem 0;
  font-family: var(--ui);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.45));
}

.sm-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75vh;
  width: 100%;
}
.sm-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid rgba(0,0,0,0.06);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transition: transform 0.4s var(--ease);
}
.sm-avatar:hover { transform: scale(1.06); }
.sm-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  font-family: var(--ui);
  font-size: clamp(0.68rem, 1.65vw, 0.82rem);
  color: #555;
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sm-meta::-webkit-scrollbar { display: none; }
.sm-meta-chunk {
  flex-shrink: 0;
}
.sm-meta-sep {
  flex-shrink: 0;
  opacity: 0.35;
  user-select: none;
}
.sm-meta a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}
.sm-meta a:hover { color: var(--gold, #cb9f4d); }

.sm-bio {
  max-width: 580px;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 1.4vh 2.2vw 1.2vh;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 16px;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(12px);
}
.sm-bio-line {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
  margin-bottom: 0.8em;
  padding-bottom: 0.6em;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sm-bio-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6em 1.6em;
}
.sm-bio-heading {
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--ink);
  margin-bottom: 0.15em;
  letter-spacing: 0.01em;
}
.sm-bio-heading strong {
  font-weight: 700;
}
.sm-bio-text {
  font-family: var(--ui);
  font-size: 0.72rem;
  color: #777;
  line-height: 1.55;
}

/* — tab bar：宽度随文字，整体居中，不与简介卡同宽 — */
.sm-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  padding: 3px;
  border-radius: 100px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
  width: fit-content;
  max-width: calc(100vw - 2rem);
  flex-shrink: 0;
  align-self: center;
}
.sm-tab {
  position: relative;
  padding: 0.5em 1.4em;
  border: none; background: none;
  font-family: var(--ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  border-radius: 100px;
  transition: color 0.35s;
  white-space: nowrap;
  letter-spacing: 0.02em;
  z-index: 1;
}
.sm-tab:hover { color: var(--ink); }
.sm-tab.active {
  color: var(--ink);
  font-weight: 600;
}
.sm-tabs-indicator {
  position: absolute;
  height: calc(100% - 6px);
  top: 3px;
  border-radius: 100px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: left 0.4s cubic-bezier(0.22,1,0.36,1), width 0.4s cubic-bezier(0.22,1,0.36,1);
  z-index: 0;
  pointer-events: none;
}

/* — marquee：相对 sm-wrap 全视口宽 breakout，消除右侧大块留白 — */
.sm-marquee {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
}
.sm-marquee:not(.static) {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  justify-content: flex-start;
  mask-image: none;
  -webkit-mask-image: none;
}
.sm-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1.2vw;
  will-change: transform;
  transition: opacity 0.35s;
}
.sm-track.fading { opacity: 0; }
/* 四个系列：单行横排；整组卡片在视口内居中，超出时可横滑 */
.sm-marquee.static {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  flex: 0 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: center;
  align-items: center;
  mask-image: none;
  -webkit-mask-image: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sm-marquee.static::-webkit-scrollbar {
  display: none;
  height: 0;
}
.sm-marquee.static .sm-track {
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  width: max-content;
  margin-inline: auto;
  padding: 0 1rem;
  box-sizing: content-box;
  will-change: auto;
}

.sm-card {
  flex: none;
  width: 170px;
  display: flex; flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.04);
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), box-shadow 0.4s cubic-bezier(0.22,1,0.36,1);
}
.sm-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}

.sm-card-img {
  width: 100%; aspect-ratio: 3 / 4;
  overflow: hidden;
}
.sm-ph {
  width: 100%; height: 100%;
  background: #1a1a1a;
}
.sm-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.sm-card:hover .sm-card-img img { transform: scale(1.06); }

.sm-card-title {
  font-family: var(--ui);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.55em 0.65em 0.15em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sm-card-likes {
  font-family: 'Inconsolata', monospace;
  font-size: 0.68rem;
  color: #aaa;
  padding: 0 0.65em 0.55em;
}
.sm-card-likes::before {
  content: '♥ ';
  color: #e74c3c;
}

/* ═══════ VIBE CODING ═══════ */
.page--vibe .vibe-inner {
  max-width: 1100px;
  width: 100%;
  text-align: center;
}

.vibe-heading {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 2rem;
}

/* 无 WebGL / 未加载脚本时仍能看到略暗的占位图（opacity:0 时双击打开文件会全空白） */
.vibe-shader-host:not(.vibe-shader-active) .vibe-shader-figure img {
  opacity: 1;
  filter: brightness(0.38);
}

.vibe-shader-host {
  position: relative;
  width: 100%;
  min-height: 12rem;
  margin: 0 auto;
}

.vibe-shader-host.vibe-shader-active .vibe-shader-figure img {
  opacity: 0;
  filter: none;
}

.vibe-shader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.vibe-shader-carousel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 3vw, 2.25rem);
  width: 100%;
  padding: 0 0.25rem;
  text-align: left;
}

.vibe-shader-figure {
  margin: 0;
  cursor: pointer;
}
.vibe-shader-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin-bottom: 0.65rem;
  border-radius: 2px;
  transition: filter 0.35s var(--ease);
}
.vibe-shader-figure figcaption {
  font-family: 'Inconsolata', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.vibe-inner {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.page.in-view .vibe-inner {
  opacity: 1; transform: translateY(0);
}

@media (max-width: 768px) {
  .vibe-shader-carousel {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════ CONTACT ═══════ */
.page--contact {
  text-align: center;
}
.contact-inner {
  max-width: 600px;
}
.contact-inner h2 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 500; font-style: italic;
  color: var(--ink);
  margin-bottom: 2.4rem;
}

.contact-grid {
  display: flex; flex-direction: column; gap: 0.8rem;
  align-items: center;
}
.contact-card {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.9rem 1.6rem;
  border-radius: 12px;
  border: 1.5px solid rgba(0,0,0,0.06);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  transition: all 0.3s var(--ease);
  min-width: 280px;
  justify-content: center;
}
.contact-card:hover {
  background: rgba(255,255,255,0.6);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-2px);
  color: var(--ink);
}
.contact-icon {
  font-size: 1.1rem;
}

/* contact reveal */
.contact-inner {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.page.in-view .contact-inner {
  opacity: 1; transform: translateY(0);
}

/* ═══════ LIGHTBOX ═══════ */
.lightbox {
  position: fixed; inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s;
  backdrop-filter: blur(6px);
}
.lightbox.active {
  opacity: 1; pointer-events: auto;
}
.lightbox img {
  max-width: 90vw; max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.lightbox-close {
  position: absolute; top: 1.5rem; right: 2rem;
  font-size: 1.6rem;
  color: #fff;
  background: none; border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

/* ═══════ CURSOR TRAIL ═══════ */
.cursor-dot {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: exclusion;
  transition: transform 0.1s;
}
.cursor-trail {
  position: fixed;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: exclusion;
  opacity: 0;
}

/* ═══════ GRAIN ═══════ */
.grain {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9000;
  opacity: 1;
}

/* ═══════ HORIZONTAL EDUCATION TIMELINE (About page) ═══════ */
.h-timeline {
  margin-top: 2rem;
  width: 100%;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.8s var(--ease) 0.3s, transform 0.8s var(--ease) 0.3s;
}
.page.in-view .h-timeline { opacity: 1; transform: translateY(0); }

.h-tl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  position: relative;
}

/* Row 2 (nodes) – the connecting line lives here */
.h-tl-node {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0;
  position: relative;
}
.h-tl-node::after {
  content: '';
  position: absolute;
  top: 50%; height: 2px;
  background: rgba(0,0,0,0.12);
}
.h-tl-node:first-of-type::after {
  left: 50%; right: 0;
  transform: translateY(-50%);
}
.h-tl-node:last-of-type::after {
  left: 0; right: 50%;
  transform: translateY(-50%);
}

.h-tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
  position: relative; z-index: 1;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* Cards */
.h-tl-card {
  padding: 0.6rem 1.2rem;
  text-align: center;
}
.h-tl-card--above { align-self: end; padding-bottom: 0; }
.h-tl-card--below { align-self: start; padding-top: 0; }
.h-tl-empty { }

.h-tl-school {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
}
.h-tl-sub {
  font-family: var(--ui);
  font-size: 0.72rem;
  font-weight: 400;
  font-style: normal;
  color: #888;
  margin-left: 0.4em;
  letter-spacing: 0.01em;
}

.h-tl-row {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 0.15em;
}
.h-tl-tag {
  font-family: var(--ui);
  font-size: 0.7rem;
  color: #888;
}

.h-tl-awards {
  list-style: none; padding: 0; margin: 0.25em 0 0;
  display: flex; gap: 1rem; justify-content: center;
}
.h-tl-awards li {
  font-family: var(--ui);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--gold, #cb9f4d);
  position: relative;
}
.h-tl-awards li + li::before {
  content: '·';
  position: absolute; left: -0.65rem;
  color: var(--gold, #cb9f4d);
}

.h-tl-date {
  display: block;
  font-family: 'Inconsolata', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: #aaa;
  letter-spacing: 0.03em;
  margin-top: 0.1em;
}
.h-tl-card--below .h-tl-date { margin-top: 0.25em; }

/* ═══════ EDUCATION TIMELINE (vertical, used by Internship) ═══════ */
.edu-section {
  width: 100%; max-width: 960px;
  margin: 0 auto; text-align: center;
}

.edu-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  font-weight: 500; font-style: italic;
  color: var(--ink);
  margin-bottom: 4.5rem;
}

.timeline {
  position: relative;
  padding: 0;
}

.timeline-line {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: var(--ink-mute);
  opacity: 0.25;
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 3rem;
  margin-bottom: 4.5rem;
  position: relative;
}

.timeline-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--ink-mute);
  z-index: 2;
  margin-top: 0.5rem;
  justify-self: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.timeline-content--left { text-align: right; }
.timeline-content--right { text-align: left; }

.timeline-date--right { text-align: left; padding-top: 0.35rem; }
.timeline-date--left  { text-align: right; padding-top: 0.35rem; }

.timeline-item--right .timeline-date--left  { grid-column: 1; }
.timeline-item--right .timeline-dot         { grid-column: 2; }
.timeline-item--right .timeline-content--right { grid-column: 3; }

.timeline-school {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600; font-style: italic;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.5rem;
  transition: color 0.25s;
}

.timeline-degree {
  font-family: var(--sans);
  font-size: 0.95rem; font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.timeline-detail {
  font-family: var(--sans);
  font-size: 0.82rem; font-weight: 400;
  color: var(--ink-mute);
}

.timeline-award {
  font-family: var(--sans);
  font-size: 0.76rem; font-weight: 500;
  color: var(--gold);
  margin-top: 0.6rem;
  letter-spacing: 0.02em;
}

.timeline-date--right,
.timeline-date--left {
  font-family: var(--sans);
  font-size: 0.95rem; font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* reveal animation */
.timeline-item {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.page.in-view .timeline-item:nth-child(2) { transition-delay: 0.15s; }
.page.in-view .timeline-item:nth-child(3) { transition-delay: 0.35s; }
.page.in-view .timeline-item {
  opacity: 1; transform: translateY(0);
}

.page.in-view .edu-title {
  opacity: 1; transform: translateY(0);
}
.edu-title {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

/* ═══════ INTERNSHIP ═══════ */

/* ── Timeline View (initial) ── */
.iw-timeline {
  width: 100%; max-width: 960px;
  margin: 0 auto; text-align: center;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.iw-timeline.hidden {
  opacity: 0; transform: scale(0.96) translateY(-10px);
  pointer-events: none;
  position: absolute; z-index: -1;
}

.iw-tl-item { cursor: pointer; }
.iw-tl-item:hover .timeline-dot {
  transform: scale(1.5);
  box-shadow: 0 0 0 4px var(--rose);
}
.iw-tl-item:hover .timeline-school { color: var(--rose); }

.iw-tl-head {
  display: flex; align-items: center; gap: 0.75rem;
}
.timeline-content--left .iw-tl-head {
  flex-direction: row-reverse;
}

.iw-tl-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 4px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.iw-tl-item:hover .iw-tl-logo {
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

/* timeline reveal */
.page--intern .timeline-item:nth-child(2) { transition-delay: 0.1s; }
.page--intern .timeline-item:nth-child(3) { transition-delay: 0.25s; }
.page--intern .timeline-item:nth-child(4) { transition-delay: 0.4s; }

/* ── Expanded View (sidebar + detail) ── */
.iw-expanded {
  display: none;
  width: 100%; max-width: 1000px;
  margin: 0 auto;
  flex-direction: row;
  gap: 2.5rem;
  align-items: flex-start;
  animation: iwFadeIn 0.5s var(--ease) both;
}
.iw-expanded.active { display: flex; }

@keyframes iwFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* sidebar */
.iw-sidebar {
  display: flex; flex-direction: column; gap: 0.6rem;
  flex: 0 0 260px;
  padding-top: 0.3rem;
}

.iw-card {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  background: transparent;
  border: 1.5px solid transparent;
  transition: all 0.3s var(--ease);
}
.iw-card:hover {
  background: rgba(255,255,255,0.7);
  transform: translateX(3px);
}
.iw-card.active {
  background: rgba(255,255,255,0.85);
  border-color: var(--ink);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.iw-logo {
  width: 38px; height: 38px;
  border-radius: 9px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.iw-info { flex: 1; min-width: 0; }
.iw-info h3 {
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 600; font-style: italic;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.08rem;
  transition: color 0.25s;
}
.iw-card:hover .iw-info h3 { color: var(--rose); }
.iw-card.active .iw-info h3 { color: var(--ink); }

.iw-sub {
  font-family: var(--sans);
  font-size: 0.66rem; font-weight: 500;
  color: var(--ink-soft);
}
.iw-date {
  font-family: var(--sans);
  font-size: 0.6rem; font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  margin-top: 0.12rem;
}

/* detail */
.iw-detail { flex: 1; min-width: 0; }

.iw-panel { display: none; }
.iw-panel.active {
  display: block;
  animation: iwSlide 0.45s var(--ease) both;
}

@keyframes iwSlide {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.iw-panel-body h4 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600; font-style: italic;
  color: var(--ink);
  margin: 1rem 0 0.3rem 0;
}
.iw-panel-body h4:first-child { margin-top: 0; }

.iw-panel-body p {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

.iw-caption {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--ink-mute);
  margin-top: 0.6rem;
}
.iw-caption a {
  color: var(--rose);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* gallery */
.iw-gallery {
  display: flex; gap: 1rem;
  margin-top: 1.5rem;
}
.iw-gallery img {
  flex: 1;
  min-width: 0;
  max-height: 260px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 18px rgba(0,0,0,0.1);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), filter 0.4s var(--ease);
}
.iw-gallery img:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 30px rgba(0,0,0,0.16);
  filter: brightness(1.04);
}

@media (max-width: 860px) {
  .iw-expanded.active { flex-direction: column; gap: 1.5rem; }
  .iw-sidebar { flex: none; flex-direction: row; overflow-x: auto; gap: 0.5rem; }
  .iw-card { min-width: 160px; }
  .iw-gallery { flex-direction: column; }
  .iw-gallery img { max-height: 180px; }
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 860px) {
  .page { padding: 5rem 1.5rem 2rem; }
  .page-inner { flex-direction: column !important; gap: 2rem; }
  .page-img { flex: none; width: 100%; }
  .topnav { padding: 0.8rem 1.2rem; }
  .topnav-links { gap: 1rem; }
  .about-top { flex-direction: column; align-items: center; gap: 1.5rem; padding-left: 0; }
  .lanyard { flex: none; height: 300px; }
  .badge { width: 150px; height: 200px; }
  .h-tl-school { font-size: 0.95rem; }
  .h-tl-sub { display: block; margin-left: 0; }
  .scroll-dots { right: 0.8rem; }
  .contact-card { min-width: auto; width: 100%; }
  .sm-content {
    max-width: 100%;
    padding: 0 0.25rem;
  }
  .sm-gallery-entry {
    width: 100px;
    height: 100px;
  }
}

/* ═══════ GALLERY OVERLAY ═══════ */
.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #f0f0f0;
  display: none;
  overflow: hidden;
  perspective: 1800px;
  -webkit-user-select: none;
  user-select: none;
}
.gallery-overlay.open {
  display: block;
}
#galleryBg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  filter: blur(24px) saturate(1.05);
  pointer-events: none;
}
.gallery-stage {
  position: absolute; inset: 0;
  z-index: 10;
  transform-style: preserve-3d;
  touch-action: none;
  cursor: grab;
}
.gallery-stage.dragging { cursor: grabbing; }
.gallery-cards {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
}
.gallery-card {
  position: absolute;
  top: 50%; left: 50%;
  width: min(26vw, 360px);
  aspect-ratio: 3/4;
  isolation: isolate;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, filter;
  transform-origin: 90% center;
  contain: layout paint;
}
.gallery-card img {
  border-radius: 15px;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.gallery-close {
  position: fixed;
  top: 2rem; right: 2.5rem;
  z-index: 10001;
  width: 48px; height: 48px;
  border: none; background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  font-size: 1.6rem;
  color: var(--ink, #2d2a26);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s, transform 0.3s;
}
.gallery-close:hover {
  background: rgba(255,255,255,0.5);
  transform: scale(1.1);
}
