/* =============================
   Editorial, B&W fashion aesthetic
   ============================= */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6a6a6a;
  --line: #111;
  --gap: clamp(12px, 2.6vw, 28px);
  --radius: 14px;

  --fs-xxs: clamp(10px, 0.75vw, 12px);
  --fs-xs: clamp(12px, 1vw, 14px);
  --fs-sm: clamp(14px, 1.2vw, 16px);
  --fs-md: clamp(16px, 1.6vw, 20px);
  --fs-lg: clamp(22px, 3vw, 40px);
  --fs-hero: clamp(48px, 10vw, 148px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--fg);
  background: var(--bg);
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Inverted theme */
body.theme-invert {
  --bg: #000;
  --fg: #f5f5f5;
  --muted: #a7a7a7;
  --line: #fff;
}

/* Links */
a {
  color: currentColor;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration: none;
}

/* ================= Nav ================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  padding: 14px clamp(12px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.nav__links a {
  text-transform: uppercase;
  font-size: var(--fs-xxs);
  letter-spacing: .14em;
  text-decoration: none;
  position: relative;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

.nav__links a:hover::after {
  transform: scaleX(1);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: var(--fs-xs);
  cursor: pointer;
}

/* Typography helpers (used in overlays) */
.lede {
  font-size: var(--fs-sm);
  margin: 6px 0 0;
}

/* ================ HERO ================ */
.hero {
  padding: 0;
}

.hero__colorfield {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  min-height: clamp(360px, 60vh, 680px);
}

.hero__block {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  outline: none;
  background: #000;
  /* default */
}

.hero__block--white {
  background: #fff;
}

.hero__block--black {
  background: #000;
}

.hero__block img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .5s ease, transform .6s ease, filter .6s ease;
  filter: contrast(1.1);
}

.hero__colorfield:hover .hero__block img {
  opacity: 1;
  transform: scale(1.05);
}

/* On touch devices (no hover), show images to avoid confusion */
@media (hover: none) {
  .hero__block img {
    opacity: 1;
    transform: none;
  }
}

/* Overlays anchored inside each block */
.hero__overlay,
.hero__overlay--cn {
  position: absolute;
  left: clamp(22px, 4vw, 64px);
  bottom: clamp(22px, 4vw, 64px);
  pointer-events: none;
  opacity: 1;
  transform: none;
  z-index: 2;
}

/* Left (English): black in B/W → #9E1DA8 on hover */
.hero__overlay {
  color: #000;
  transition: color .25s ease;
}

.hero__colorfield:hover .hero__overlay {
  color: #9E1DA8;
}

/* Right (Chinese): white in B/W → #FFE55B on hover */
.hero__overlay--cn {
  color: #fff;
  transition: color .25s ease;
}

.hero__colorfield:hover .hero__overlay--cn {
  color: #FFE55B;
}

/* ============== Marquee ============== */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  user-select: none;
}

.marquee__inner {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 22s linear infinite;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: var(--fs-xs);
  padding: 12px 0;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* ============== Sections ============== */
.section {
  padding: clamp(48px, 8vw, 120px) 0;
}

.section--tight {
  padding-block: clamp(32px, 6vw, 84px);
}

.section--narrow {
  max-width: 900px;
  margin-inline: auto;
}

.section__head {
  padding: 0 clamp(12px, 3vw, 40px) clamp(18px, 2.2vw, 28px);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  justify-content: space-between;
}

.section__head h2 {
  font-size: var(--fs-lg);
  margin: 0;
  letter-spacing: -.02em;
}

/* ============== Research timeline ============== */
.timeline {
  list-style: none;
  padding: 0 clamp(12px, 3vw, 40px);
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
  border-left: 1px solid var(--line);
  margin-left: clamp(12px, 3vw, 40px);
}

.timeline__item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--gap);
  padding-left: clamp(10px, 1.2vw, 16px);
}

.timeline__year {
  font-size: var(--fs-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline__body h3 {
  margin: 0 0 6px;
  font-size: var(--fs-md);
}

.timeline__body p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  max-width: 70ch;
}

/* ============== Art grid (albums + gallery) ============== */
.art-grid {
  padding: 0 clamp(12px, 3vw, 40px);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(8px, 1vw, 16px);
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  outline: 1px solid var(--line);
  grid-column: span 4;
  aspect-ratio: 4/5;
}

.tile--wide {
  grid-column: span 8;
  aspect-ratio: 16/9;
}

.tile--tall {
  grid-column: span 4;
  aspect-ratio: 3/5;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.05) brightness(0.98);
  transform: scale(1.02);
  transition: filter .5s ease, transform .6s ease;
}

.tile:hover img {
  filter: grayscale(0%) contrast(1.1) brightness(1);
  transform: scale(1.06);
}

/* Hide figcaptions visually but keep for accessibility */
.tile figcaption {
  position: absolute;
  inset: auto auto 8px 8px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Album header controls */
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.album-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============== Copy blocks ============== */
.copy {
  padding: 0 clamp(12px, 3vw, 40px);
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: 1.6;
}

/* ============== Footer ============== */
.footer {
  border-top: 1px solid var(--line);
  padding: 18px clamp(12px, 3vw, 40px);
  font-size: var(--fs-xs);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============== Reveal on scroll ============== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .6s ease, transform .6s ease;
}

/* Motion-safe */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============== Responsive ============== */
@media (max-width: 1100px) {

  /* Let grid collapse just a bit later for smoother transition */
  .hero__colorfield {
    grid-template-columns: 1fr;
    min-height: clamp(420px, 70vh, 780px);
  }

  .hero__block {
    min-height: 48vh;
  }
}

@media (max-width: 980px) {
  .tile {
    grid-column: span 6;
  }

  .tile--wide {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {
  .nav {
    grid-template-columns: auto 1fr auto;
  }

  .nav__toggle {
    display: inline-flex;
  }

  .nav__links {
    position: fixed;
    inset: 58px 12px auto 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
  }

  .nav__links.open {
    display: flex;
  }

  .nav__links a {
    padding: 12px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .tile {
    grid-column: span 12;
  }
}


.social-icons {
  display: flex;
  gap: 14px;
  align-items: center;
}

.social-icons a {
  color: var(--fg);
  text-decoration: none;
}

.social-icons a:hover {
  color: var(--muted);
}

/* ============================
   RESEARCH — centered list, theme-adaptive titles, gray body copy
   ============================ */

/* Accent color for this section; switches in invert mode to match site vibe */
#research {
  --accent: #9E1DA8;
}

/* matches hero's purple hover */
body.theme-invert #research {
  --accent: #FFE55B;
}

/* high-contrast accent in dark invert */

/* Center the block and give it a fluid container */
#research .research-list {
  max-width: min(1000px, 92vw);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 48px);
}

/* List items (no boxes) with comfy spacing */
#research .research-item {
  position: relative;
  padding: clamp(18px, 2vw, 28px) 0;
}

/* Thin divider between items */
#research .research-item+.research-item {
  border-top: 1px solid var(--line);
}

/* Titles: follow theme color; accent on hover */
#research .research-item h3 {
  margin: 0 0 6px;
  font-size: var(--fs-md);
  letter-spacing: -.01em;
  color: var(--fg);
  /* theme-adaptive base (light/dark) */
  transition: color .25s ease, text-decoration-color .25s ease;
}

#research .research-item:hover h3 {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Body copy: same gray as other sections */
#research .research-item p {
  margin: 0;
  color: var(--muted);
  /* sitewide muted gray */
  font-size: var(--fs-sm);
  line-height: 1.55;
  max-width: 75ch;
}

/* Keep your reveal animation behavior smooth here too */
#research .research-item.reveal.is-in {
  transition: opacity .6s ease, transform .6s ease, color .25s ease;
}

/* Mobile tweaks */
@media (max-width: 720px) {
  #research .research-list {
    padding-inline: clamp(14px, 4vw, 28px);
  }
}

/* ===== About: 自适应头像 ===== */
.about__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 标题和头像居中 */
  gap: 4px;
  /* 标题和头像之间的间距，可以调大/调小 */
}

.about__head h2 {
  margin: 0;
  /* 去掉默认的上下外边距 */
}

.about__avatar {
  --avatar-size: 240px;
  /* 桌面端头像大小，可以改成96px或150px */
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  /* 圆形 */
  overflow: hidden;
  /* 超出部分裁切 */
  margin: 0 auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* 平滑过渡 */
}

.about__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 填满容器，保持比例 */
  display: block;
}

/* Hover 效果：放大 + 光晕 */
.about__avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

/* 小屏幕时头像适度缩小 */
@media (max-width: 720px) {
  .about__avatar {
    --avatar-size: 96px;
  }
}