/* Motion that Webflow Interactions used to provide.
   Start states only apply once JS is running (html.js), so the site
   stays fully readable if scripts are blocked. */

html.js .background-video,
html.js .background-video-2 { opacity: 0; transition: opacity 1.4s ease; }
html.js .background-video.is-in,
html.js .background-video-2.is-in { opacity: 1; }

html.js .container-2 .heading {
  opacity: 0; filter: blur(10px);
  transition: opacity 1.2s ease, filter 1.2s ease;
}
html.js .container-2 .paragraph {
  opacity: 0; transform: translate3d(0, 40px, 0);
  transition: opacity 1s ease .5s, transform 1s ease .5s;
}
html.js .container-2.is-in .heading { opacity: 1; filter: blur(0); }
html.js .container-2.is-in .paragraph { opacity: 1; transform: none; }

html.js .div-block > * {
  opacity: 0; filter: blur(5px);
  transition: opacity 1s ease, filter 1s ease;
}
html.js .div-block > :nth-child(2) { transition-delay: .15s; }
html.js .div-block > :nth-child(3) { transition-delay: .3s; }
html.js .div-block.is-in > * { opacity: 1; filter: blur(0); }

html.js .div-block-2 {
  transform: translate3d(300px, 0, 0);
  transition: transform 1s cubic-bezier(.2, .7, .2, 1);
}
html.js .div-block-2.is-in { transform: none; }

/* mobile menu */
@media screen and (max-width: 767px) {
  .menu.is-open { display: flex; }
  .menu-2 .menu_line { transition: transform .3s ease, opacity .3s ease; }
  .menu-2.is-open .menu_line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-2.is-open .menu_line:nth-child(2) { opacity: 0; }
  .menu-2.is-open .menu_line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

@media (prefers-reduced-motion: reduce) {
  html.js * { transition: none !important; }
}

/* ---------- EN / 中文 ---------- */
html:not(.zh) [data-l="zh"],
html.zh [data-l="en"] { display: none !important; }
html.zh body {
  font-family: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
.lang-switch {
  background: none; border: 0; cursor: pointer;
  font-family: inherit; gap: 6px; align-items: center;
}
.lang-switch .ls-en, .lang-switch .ls-zh, .lang-switch .ls-sep { color: #696969; transition: color .2s; }
html:not(.zh) .lang-switch .ls-en,
html.zh .lang-switch .ls-zh { color: #fff; }
html:not(.zh) .lang-switch:hover .ls-zh, html.zh .lang-switch:hover .ls-en { color: #bdbdbd; }
.menu .lang-switch { font-size: 20px; line-height: 28px; display: flex; gap: 10px; margin-top: 12px; padding: 0; }

/* ---------- Design / Research cards: dim image, reveal name (matches the Webflow hover) ---------- */
.design_block .image {
  transform-origin: 50% 50%;
  transition: opacity .5s linear, transform .5s linear;
  will-change: opacity, transform;
}
.design_block .text-block {
  opacity: 0;
  transition: opacity .5s linear;
}
.design_block:hover .image,
.design_block:focus-visible .image {
  opacity: .2;
  transform: scale(1.02);
  transition-timing-function: cubic-bezier(.25, .46, .45, .94);
}
.design_block:hover .text-block,
.design_block:focus-visible .text-block {
  opacity: 1;
  transition-timing-function: cubic-bezier(.25, .46, .45, .94);
}
/* phones/tablets have no hover: keep names readable */
@media (hover: none) {
  .design_block .image { opacity: .55; }
  .design_block .text-block { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .design_block .image, .design_block .text-block { transition: none; }
}

/* ---------- Home: keep hero text readable over bright video frames ---------- */
.background-video::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.6) 35%, rgba(0,0,0,.25) 55%, rgba(0,0,0,0) 75%),
    linear-gradient(to right, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 70%);
}
.container-2 .heading,
.container-2 .paragraph { text-shadow: 0 1px 18px rgba(0,0,0,.35); }
@media screen and (max-width: 767px) {
  .background-video::after {
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.6) 45%, rgba(0,0,0,.1) 80%);
  }
}

/* ---------- Magnetic nav tab (desktop) ---------- */
.nav_info_block { position: relative; }
.nav_info_block > a, .nav_info_block > button { position: relative; z-index: 1; }
.magnetic-pill {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  border-radius: 10px;
  background: rgba(150, 150, 150, .28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  pointer-events: none; z-index: 0;
  opacity: 0; transition: opacity .25s ease;
  will-change: transform, width, height;
}
.magnetic-pill.is-on { opacity: 1; }
.nav_info_block .nav_link > div,
.nav_info_block .lang-switch > span { display: inline-block; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.nav_info_block .nav_link:hover > div,
.nav_info_block .lang-switch:hover > span { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
  .nav_info_block .nav_link > div, .nav_info_block .lang-switch > span { transition: none; }
}

/* ---------- Design page: uniform 4 x 3 grid, empty slots first ---------- */
.design_grid {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 40vh);
  grid-auto-rows: 40vh;
}
.design_grid > .design_block { grid-area: auto; min-width: 0; }
.design_grid .image { height: 100%; }
.design_empty { pointer-events: none; }
@media screen and (max-width: 991px) {
  .design_grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; }
  .design_empty { display: none; }   /* no blank rows on tablets/phones */
}

/* small subtitle under a card name */
.text_block .text-block { text-align: center; }
.card-sub {
  display: block;
  margin-top: 6px;
  font-size: 13px; line-height: 18px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: .2px;
  opacity: .6;
}

/* cards that don't have a cover image yet: show the name, no hover needed */
.card-noimg { background: #0d0d0d; outline: 1px solid #1c1c1c; outline-offset: -1px; justify-content: center; }
.card-noimg .text-block { opacity: 1; }

/* =====================================================================
   Research page: bio (left) + expandable research theme (right)
   ===================================================================== */
.rs-page {
  display: grid;
  grid-template-columns: minmax(220px, 24%) 1fr;
  column-gap: 6vw;
  padding: calc(8vh + 4.5rem) 4rem 8rem;
  min-height: 100vh;
  color: #fff;
}
.rs-page h1, .rs-page h3, .rs-page p, .rs-page figure { margin: 0; }

.rs-bio { position: sticky; top: calc(8vh + 3rem); align-self: start; }
.rs-avatar {
  width: 128px; height: 128px; border-radius: 16px; overflow: hidden;
  background: #151515;
}
.rs-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.rs-name { margin-top: 1.4rem !important; font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -.01em; }
.rs-role { margin-top: .45rem !important; font-size: 15px; line-height: 21px; color: #dcdcdc; }
.rs-affil { margin-top: .25rem !important; font-size: 14px; line-height: 20px; color: #8a8a8a; }

/* theme header with + */
.rs-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.5rem 0; background: none; border: 0; border-top: 1px solid rgba(255,255,255,.85);
  color: #fff; font-family: inherit; text-align: left; cursor: pointer;
}
.rs-theme-title { font-size: 24px; line-height: 31px; font-weight: 500; letter-spacing: -.01em; }
.rs-plus {
  flex: none; position: relative; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), background-color .25s, border-color .25s;
}
.rs-plus::before, .rs-plus::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: #fff;
  transform: translate(-50%, -50%);
}
.rs-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.rs-toggle:hover .rs-plus { background: rgba(150,150,150,.28); border-color: transparent; }
.rs-theme.is-open .rs-plus { transform: rotate(45deg); }

/* smooth expand: 0fr -> 1fr */
.rs-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s cubic-bezier(.2, .7, .2, 1); }
.rs-theme.is-open .rs-panel { grid-template-rows: 1fr; }
.rs-panel-inner { overflow: hidden; min-height: 0; }

.rs-intro { padding: .25rem 0 1.5rem; font-size: 15px; line-height: 22px; color: #8a8a8a; max-width: 46em; }

/* project rows, laid out like the reference: text left, image right */
.rs-item {
  display: grid; grid-template-columns: 1.35fr 1fr; column-gap: 2.5rem; align-items: center;
  padding: 2.25rem 0; border-top: 1px solid #222;
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.rs-theme.is-open .rs-item { opacity: 1; transform: none; }
.rs-theme.is-open .rs-item:nth-of-type(1) { transition-delay: .15s; }
.rs-theme.is-open .rs-item:nth-of-type(2) { transition-delay: .23s; }
.rs-theme.is-open .rs-item:nth-of-type(3) { transition-delay: .31s; }
.rs-theme.is-open .rs-item:nth-of-type(4) { transition-delay: .39s; }
.rs-theme.is-open .rs-item:nth-of-type(5) { transition-delay: .47s; }

.rs-label { font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: .04em; }
.rs-sub { margin-top: .3rem !important; font-size: 12.5px; line-height: 18px; color: #8a8a8a; }
.rs-q { margin-top: 1rem !important; font-size: 18px; line-height: 25px; font-weight: 600; }
.rs-body { margin-top: 1rem !important; font-size: 15px; line-height: 23px; font-weight: 300; color: #cfcfcf; max-width: 40em; }

.rs-media { aspect-ratio: 2.3 / 1; overflow: hidden; background: #111; }
.rs-media img, .rs-media video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.rs-item:hover .rs-media img, .rs-item:hover .rs-media video { transform: scale(1.03); }

@media screen and (max-width: 991px) {
  .rs-page { grid-template-columns: 1fr; row-gap: 3rem; padding: calc(8vh + 3rem) 2rem 6rem; }
  .rs-bio { position: static; }
  .rs-item { grid-template-columns: 1fr; row-gap: 1.25rem; }
  .rs-media { order: -1; }
}
@media screen and (max-width: 479px) {
  .rs-page { padding-left: 1.25rem; padding-right: 1.25rem; }
  .rs-theme-title { font-size: 20px; line-height: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .rs-panel, .rs-item, .rs-plus, .rs-media img, .rs-media video { transition: none !important; }
}

/* Research: citation, note and role line */
.rs-cite { margin-top: .55rem !important; font-size: 13px; line-height: 19px; color: #9a9a9a; max-width: 44em; }
.rs-cite a { color: inherit; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: color .2s, background-size .35s; }
.rs-cite a:hover { color: #fff; background-size: 100% 1px; }
.rs-cite b { color: #e6e6e6; font-weight: 600; }
.rs-cite i { font-style: italic; color: #c4c4c4; }
.rs-cite .rs-arrow { display: inline-block; margin-left: .15em; color: #fff; transition: transform .25s; }
.rs-cite a:hover .rs-arrow { transform: translate(2px, -2px); }
.rs-note { margin-top: .25rem !important; font-size: 11.5px; line-height: 16px; color: #6a6a6a; }
.rs-role-line { margin-top: 1.1rem !important; font-size: 13px; line-height: 19px; color: #cfcfcf; }
.rs-role-line span { display: inline-block; margin-right: .6em; color: #6a6a6a; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.rs-media--fit { aspect-ratio: auto; background: transparent; }
.rs-media--fit img { height: auto; }

/* Research v2: bio lines, years, typing caret, theme reveal */
.rs-lines { list-style: none; margin: .7rem 0 0; padding: 0; }
.rs-lines li { margin: 0 0 .3rem; font-size: 14.5px; line-height: 20px; color: #dcdcdc; }
.rs-lines li:first-child { color: #fff; font-weight: 500; }
.rs-bio .rs-affil { margin-top: .55rem !important; font-size: 12.5px; line-height: 18px; color: #7a7a7a; }
.rs-years { margin-left: .5em; font-size: .62em; font-weight: 400; color: #7a7a7a; letter-spacing: .02em; white-space: nowrap; }
.rs-main > .rs-theme:last-child { border-bottom: 1px solid #222; }

/* typing: hidden remainder keeps the final layout, so nothing jumps */
.t-rest { visibility: hidden; }
.t-on .t-shown::after {
  content: ""; display: inline-block; width: .5em; height: 1.05em; margin-left: 1px;
  vertical-align: -.15em; background: currentColor; animation: t-blink .9s steps(1) infinite;
}
@keyframes t-blink { 50% { opacity: 0; } }

html.js .rs-main > .rs-theme { opacity: 0; transform: translateY(16px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
html.js .rs-main > .rs-theme.is-in { opacity: 1; transform: none; }

.rs-links { margin-top: 1.1rem !important; display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: 13px; line-height: 19px; }
.rs-links a { color: #cfcfcf; text-decoration: none; border-bottom: 1px solid #444; padding-bottom: 1px; transition: color .2s, border-color .2s; }
.rs-links a:hover { color: #fff; border-color: #fff; }
.rs-links .rs-arrow { display: inline-block; transition: transform .25s; }
.rs-links a:hover .rs-arrow { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  html.js .rs-main > .rs-theme { transition: none; }
  .t-on .t-shown::after { animation: none; }
}

/* bio bullets: hanging indent so wrapped lines line up with the text */
.rs-lines li { position: relative; padding-left: 1em; }
.rs-lines li::before {
  content: ""; position: absolute; left: .1em; top: .62em;
  width: 4px; height: 4px; border-radius: 50%; background: #8a8a8a;
}
.rs-lines li:first-child::before { background: #fff; }
.rs-lines li { margin-bottom: .45rem; }
.rs-role-line { max-width: 40em; }

/* portrait: plain photo, no frame */
.rs-avatar { width: 160px; height: 200px; border-radius: 0; background: none; }

/* bullets pop in when their line starts typing */
.rs-lines li::before { transition: opacity .25s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.rs-lines li.t-pending::before { opacity: 0; transform: scale(0); }
.rs-lines li.t-on::before, .rs-lines li.t-done::before { opacity: 1; transform: scale(1); }
/* first role line (EN + ZH copies are children 1 and 2) */
.rs-lines li:nth-child(-n+2) { color: #fff; font-weight: 500; }
.rs-lines li:nth-child(-n+2)::before { background: #fff; }
.rs-support { margin-top: .4rem !important; font-size: 13px; line-height: 19px; font-weight: 700; color: #fff; }

/* About: new hero image (blue tubing) + a light top shade so the white nav stays readable */
.section {
  position: relative;
  background-image: url("/assets/about-hero-tubes.jpg");
  background-position: 50% 45%;
}
.section::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 120px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.38), rgba(0,0,0,0));
}

/* About: media links under the bio */
.about-media { margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid #e3e3e3; }
.about-media p { margin: 0; }
.about-media-label { font-size: 12px; line-height: 18px; letter-spacing: .06em; text-transform: uppercase; color: #8a8a8a; }
.about-media-links { margin-top: .6rem !important; display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; font-size: 15px; line-height: 22px; }
.about-media-links a { color: #1d1d1d; text-decoration: none; border-bottom: 1px solid #cfcfcf; padding-bottom: 1px; transition: border-color .2s, color .2s; }
.about-media-links a:hover { border-color: #1d1d1d; }
.about-media-links .media-arrow { display: inline-block; margin-left: .25em; transition: transform .25s; }
.about-media-links a:hover .media-arrow { transform: translate(2px, -2px); }

/* Morphility detail: two portrait images, columns sized so both share one height */
.mp-pair{display:grid;grid-template-columns:707fr 750fr;gap:1rem;margin:10vh 0 12vh;align-items:start}
.mp-pair img{width:100%;height:auto;display:block}
@media (max-width:767px){.mp-pair{grid-template-columns:1fr}}

/* Detail-page gallery: rows of two equal-ratio images */
.dp-gallery{display:flex;flex-direction:column;gap:1rem;margin:10vh 0 12vh}
.dp-row{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.dp-row img{width:100%;height:auto;display:block}
@media (max-width:767px){.dp-row{grid-template-columns:1fr}}
.dp-full{width:100%;height:auto;display:block}
.paragraph-2 strong{font-weight:600}
.dp-gallery .dp-full + .dp-full{margin-top:0}

/* Home hero text: smaller, anchored bottom-left */
.container-2 { margin: 0 0 0 4rem; inset: auto auto 7vh 0; width: auto; max-width: 720px; }
.container-2 .heading { font-size: 40px; line-height: 44px; margin-bottom: 0; }
.container-2 .paragraph { margin-top: 32px; font-size: 24px; line-height: 30px; color: rgba(255,255,255,.72); }
.container-2 .paragraph[lang="zh-CN"] { font-size: 22px; line-height: 34px; }
@media screen and (max-width: 991px) {
  .container-2 .heading { font-size: 34px; line-height: 40px; }
  .container-2 .paragraph { font-size: 20px; line-height: 27px; }
  .container-2 .paragraph[lang="zh-CN"] { font-size: 18px; line-height: 29px; }
}
@media screen and (max-width: 767px) {
  .container-2 .paragraph[lang="zh-CN"] { font-size: 14px; line-height: 23px; }
  .container-2 { margin: 0 1.5rem; max-width: none; inset: auto 0 6vh 0; }
  .container-2 .heading { font-size: 24px; line-height: 30px; }
  .container-2 .paragraph { font-size: 14px; line-height: 21px; }
}
