:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: #121212;
  --fg: #f1f0ec;
  --muted: #969690;
  --line: rgba(241, 240, 236, 0.18);
  --accent: #3157ff;
  --page: clamp(1rem, 2.5vw, 2.25rem);
  --sans: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
p, h1, h2, h3 { margin: 0; }

::selection { background: var(--accent); color: var(--fg); }

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.85'/%3E%3C/svg%3E");
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page);
  mix-blend-mode: difference;
}

.brand { font-size: 1rem; font-weight: 650; letter-spacing: -0.04em; }
.site-header nav { display: flex; gap: clamp(1.15rem, 3vw, 3.25rem); }
.site-header nav a {
  position: relative;
  display: grid;
  height: 1.35em;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.35;
}
.site-header nav a span { transition: transform 500ms cubic-bezier(.16, 1, .3, 1); }
.site-header nav a span:last-child { position: absolute; transform: translateY(110%); }
.site-header nav a:hover span:first-child,
.site-header nav a:focus-visible span:first-child { transform: translateY(-110%); }
.site-header nav a:hover span:last-child,
.site-header nav a:focus-visible span:last-child { transform: translateY(0); }

.hero {
  position: relative;
  min-height: 100dvh;
  padding: 5.25rem var(--page) 1.6rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.hero-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--muted); font-size: 0.82rem; }
.hero-title {
  grid-column: 1 / -1;
  align-self: center;
  width: 100%;
  font-size: clamp(5.4rem, 15.25vw, 14.8rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.72;
}
.hero-title .line { display: block; overflow: hidden; padding: 0 0.04em 0.12em 0; }
.hero-title .line > span { display: block; transform: translateY(112%); }
.hero-title .line-en { text-align: right; font-size: 0.72em; letter-spacing: -0.065em; color: transparent; -webkit-text-stroke: 1.5px var(--fg); }
.particle-hero {
  align-self: stretch;
  min-height: 0;
  display: grid;
  grid-template-rows: 1.06fr 0.94fr;
  font-size: inherit;
  line-height: 1;
}
.particle-text {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
  isolation: isolate;
}
.particle-name-zh { width: 62%; }
.particle-name-en { width: 74%; margin-left: auto; }
.particle-text__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 240ms ease;
}
.particle-text.is-ready .particle-text__canvas { opacity: 1; }
.particle-text__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  color: var(--fg);
  font-size: clamp(5.4rem, 15.25vw, 14.8rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.particle-name-en .particle-text__fallback {
  justify-content: flex-end;
  color: transparent;
  font-size: clamp(3rem, 10vw, 9.5rem);
  letter-spacing: -0.065em;
  -webkit-text-stroke: 1.5px var(--fg);
}
.particle-text.is-ready .particle-text__fallback { opacity: 0; }
.particle-text__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hero-note { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; font-size: clamp(0.85rem, 1vw, 1rem); }
.hero-note p:last-child { color: var(--muted); text-align: right; }

.statement {
  min-height: 100dvh;
  padding: 22vh var(--page) 10vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.33fr);
  align-content: center;
  gap: 3rem;
}
.statement-zh {
  font-size: clamp(2.8rem, 7.2vw, 8rem);
  letter-spacing: -0.06em;
  line-height: 1.08;
  font-weight: 500;
}
.statement-en { align-self: end; max-width: 31rem; color: var(--muted); font-size: clamp(1.05rem, 1.55vw, 1.55rem); line-height: 1.35; }

.work { padding: 8rem var(--page) 12rem; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.section-heading h2 { font-size: clamp(2.2rem, 4.5vw, 4.5rem); font-weight: 500; letter-spacing: -0.06em; }
.section-heading p { color: var(--muted); }

.work-feed {
  margin-bottom: clamp(7rem, 12vw, 12rem);
  border-top: 1px solid var(--line);
}
.work-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.55fr) 1.5fr minmax(10rem, 0.75fr) auto;
  align-items: center;
  gap: 1.25rem;
  min-height: clamp(6.5rem, 10vw, 10.5rem);
  border-bottom: 1px solid var(--line);
  transition: color 350ms ease, background-color 350ms ease, padding 500ms cubic-bezier(.16, 1, .3, 1);
}
.work-row:hover,
.work-row:focus-visible {
  padding-inline: 1.25rem;
  background: var(--fg);
  color: var(--bg);
}
.work-type, .work-en { font-size: 0.82rem; }
.work-en { color: var(--muted); transition: color 350ms ease; }
.work-row:hover .work-en,
.work-row:focus-visible .work-en { color: #50504d; }
.work-name { font-size: clamp(2rem, 4.7vw, 5.2rem); font-weight: 500; letter-spacing: -0.06em; line-height: 0.95; }
.work-name small { display: block; margin-top: 0.28em; color: var(--muted); font-size: 0.24em; font-weight: 400; letter-spacing: 0; }
.work-row:hover .work-name small,
.work-row:focus-visible .work-name small { color: #50504d; }
.work-arrow { font-size: 1.4rem; transition: transform 450ms cubic-bezier(.16, 1, .3, 1); }
.work-row:hover .work-arrow,
.work-row:focus-visible .work-arrow { transform: translate(0.25rem, -0.25rem); }
.category-row { grid-template-columns: minmax(6rem, 0.42fr) 1.3fr minmax(11rem, 0.68fr) auto; }
.work-thumb { display: block; overflow: hidden; aspect-ratio: 1.97 / 1; background: var(--surface); }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms cubic-bezier(.16, 1, .3, 1); }
.category-row:hover .work-thumb img,
.category-row:focus-visible .work-thumb img { transform: scale(1.045); }

.project { margin-bottom: clamp(7rem, 14vw, 14rem); }
.project-media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface);
}
.project-one .project-media { margin-left: 8vw; }
.project-two .project-media { width: 78%; }
.project-media::after {
  content: "View Project";
  position: absolute;
  inset: auto 1.2rem 1.2rem auto;
  padding: 0.72rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8rem;
  transform: translateY(calc(100% + 1.2rem));
  transition: transform 500ms cubic-bezier(.16, 1, .3, 1);
}
.project-media:hover::after,
.project-media:focus-visible::after { transform: translateY(0); }
.project-media img { aspect-ratio: 3 / 2; object-fit: cover; transform: scale(1.04); transition: transform 1000ms cubic-bezier(.16, 1, .3, 1); }
.project-media:hover img,
.project-media:focus-visible img { transform: scale(1); }
.project-info {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  padding-top: 1.2rem;
  font-size: 0.88rem;
}
.project-info h3 { font-size: 1.2rem; font-weight: 500; letter-spacing: -0.025em; }
.project-info > p:nth-child(2) { color: var(--muted); }
.pending-projects {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.pending-projects p { color: var(--fg); }

.profile {
  min-height: 100dvh;
  padding: 16vh var(--page) 12vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 9rem;
  border-top: 1px solid var(--line);
}
.profile-intro h2 { max-width: 13ch; font-size: clamp(3.4rem, 8vw, 9rem); font-weight: 500; letter-spacing: -0.07em; line-height: 0.98; }
.profile-en { margin: 4rem 0 0 auto; max-width: 31rem; color: var(--muted); font-size: clamp(1.2rem, 2vw, 2rem); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12vw; margin-left: 26vw; }
.profile-grid p { max-width: 35rem; font-size: clamp(1rem, 1.4vw, 1.35rem); }
.profile-grid p:last-child { color: var(--muted); }
.profile-fact { padding-top: 1rem; border-top: 1px solid var(--line); }
.profile-fact > span { display: block; margin-bottom: 1.4rem; color: var(--muted); font-size: 0.82rem; }
.profile-fact p { line-height: 1.5; }
.profile-fact p:last-child { color: var(--fg); }

.contact {
  min-height: 100dvh;
  padding: 6rem var(--page) 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--accent);
}
.contact-top { display: flex; justify-content: space-between; }
.contact h2 { font-size: clamp(4.8rem, 14vw, 14rem); line-height: 0.79; letter-spacing: -0.08em; font-weight: 500; }
.contact h2 a { display: inline-block; }
.contact h2 span { display: inline-block; color: transparent; -webkit-text-stroke: 1.5px var(--fg); transition: color 400ms ease; }
.contact h2 a:hover span,
.contact h2 a:focus-visible span { color: var(--fg); }
.contact-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--page);
  margin-left: 26vw;
}
.contact-details a {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(241, 240, 236, 0.45);
  transition: padding 400ms cubic-bezier(.16, 1, .3, 1);
}
.contact-details a:hover,
.contact-details a:focus-visible { padding-inline: 0.75rem; }
.contact-details span { color: rgba(241, 240, 236, 0.68); font-size: 0.8rem; }
.contact-details strong { font-size: clamp(1rem, 1.55vw, 1.45rem); font-weight: 500; letter-spacing: -0.025em; }
.contact footer { display: flex; justify-content: space-between; padding-top: 1.25rem; border-top: 1px solid rgba(241, 240, 236, 0.45); font-size: 0.8rem; }

.detail-page { min-height: 100dvh; }
.detail-hero {
  min-height: 100dvh;
  padding: 5.25rem var(--page) 1.6rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
.detail-meta, .detail-bottom { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.82rem; }
.detail-title {
  align-self: center;
  font-size: clamp(4rem, 11.8vw, 12rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.82;
}
.detail-title .line { display: block; overflow: hidden; padding: 0 0.04em 0.12em 0; }
.detail-title .line > span { display: block; transform: translateY(112%); }
.detail-title-en { text-align: right; font-size: 0.62em; color: transparent; -webkit-text-stroke: 1.5px var(--fg); }
.detail-copy {
  min-height: 100dvh;
  padding: 16vh var(--page) 10vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8rem;
  border-top: 1px solid var(--line);
}
.detail-copy h2 { max-width: 14ch; font-size: clamp(3rem, 7.2vw, 7.5rem); font-weight: 500; letter-spacing: -0.065em; line-height: 1.03; }
.detail-copy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12vw; margin-left: 24vw; }
.detail-copy-grid p { max-width: 36rem; font-size: clamp(1rem, 1.45vw, 1.4rem); }
.detail-copy-grid p:last-child { color: var(--muted); }
.experience-project { padding: 8rem var(--page) 12rem; }
.experience-project > p { margin-bottom: 2rem; color: var(--muted); }
.experience-list { border-top: 1px solid var(--line); }
.experience-item {
  display: grid;
  grid-template-columns: 5rem minmax(13rem, 0.7fr) 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.experience-item > span { color: var(--muted); font-size: 0.8rem; }
.experience-item h3 { font-size: clamp(1.35rem, 2.3vw, 2.5rem); font-weight: 500; letter-spacing: -0.04em; }
.experience-item p { max-width: 42rem; color: var(--muted); font-size: clamp(0.95rem, 1.2vw, 1.15rem); }
.internship-gallery {
  padding: 5rem var(--page) 12rem;
  border-top: 1px solid var(--line);
}
.internship-gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(4rem, 8vw, 8rem);
}
.internship-gallery-head p,
.internship-gallery-head > span { color: var(--muted); font-size: 0.82rem; }
.internship-gallery-head h2 {
  margin-top: 1rem;
  font-size: clamp(3.6rem, 9vw, 9.5rem);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.9;
}
.drift-wall-shell {
  position: relative;
  width: calc(100% + var(--page) * 2);
  height: min(88dvh, 900px);
  min-height: 640px;
  margin-left: calc(var(--page) * -1);
  overflow: hidden;
  background: #070707;
}
.drift-wall {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  perspective: var(--dw-perspective, 1200px);
  perspective-origin: 50% 50%;
  --dw-tile-w: 240px;
  --dw-tile-h: 158px;
  --dw-gap: 18px;
  --dw-radius: 0px;
  --dw-lift: 58px;
  --dw-dim: 0.52;
  --dw-overlay: #050505;
  --dw-edge: 34%;
  -webkit-mask-image: radial-gradient(ellipse 82% 88% at 50% 48%, #000 var(--dw-edge), transparent 100%);
  mask-image: radial-gradient(ellipse 82% 88% at 50% 48%, #000 var(--dw-edge), transparent 100%);
}
.drift-wall__plane {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: row;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform;
}
.drift-wall__col {
  position: relative;
  width: calc(var(--dw-tile-w) + var(--dw-gap));
  transform-style: preserve-3d;
}
.drift-wall__track {
  display: flex;
  flex-direction: column;
  will-change: transform;
  transform-style: preserve-3d;
}
.drift-wall__tile {
  position: relative;
  display: block;
  width: 100%;
  height: calc(var(--dw-tile-h) + var(--dw-gap));
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  transform-style: preserve-3d;
  cursor: zoom-in;
}
.drift-wall__inner {
  position: absolute;
  inset: calc(var(--dw-gap) / 2);
  display: block;
  overflow: hidden;
  border-radius: var(--dw-radius);
  background: #111;
  opacity: var(--dw-dim);
  transform: translateZ(0);
  pointer-events: none;
  transition: transform 420ms cubic-bezier(.22, 1, .36, 1), opacity 420ms cubic-bezier(.22, 1, .36, 1), box-shadow 420ms cubic-bezier(.22, 1, .36, 1);
}
.drift-wall__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.15) saturate(0.9);
  transition: filter 420ms cubic-bezier(.22, 1, .36, 1), transform 700ms cubic-bezier(.22, 1, .36, 1);
  user-select: none;
  -webkit-user-drag: none;
}
.drift-wall__overlay {
  position: absolute;
  inset: 0;
  background: var(--dw-overlay);
  opacity: 0.36;
  pointer-events: none;
  transition: opacity 420ms cubic-bezier(.22, 1, .36, 1);
}
.drift-wall__index {
  position: absolute;
  right: 0.65rem;
  bottom: 0.5rem;
  z-index: 1;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}
.drift-wall__tile.is-active .drift-wall__inner,
.drift-wall__tile:focus-visible .drift-wall__inner {
  opacity: 1;
  transform: translateZ(var(--dw-lift));
  box-shadow: 0 26px 70px -20px rgba(0, 0, 0, 0.9);
}
.drift-wall__tile.is-active img,
.drift-wall__tile:focus-visible img { filter: grayscale(0) saturate(1.04); transform: scale(1.025); }
.drift-wall__tile.is-active .drift-wall__overlay,
.drift-wall__tile:focus-visible .drift-wall__overlay { opacity: 0; }
.drift-wall__tile:focus-visible .drift-wall__inner { box-shadow: 0 26px 70px -20px rgba(0, 0, 0, 0.9), 0 0 0 2px var(--fg); }
.drift-wall-hint {
  position: absolute;
  inset: auto var(--page) 1rem;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: rgba(241, 240, 236, 0.62);
  font-size: 0.75rem;
  pointer-events: none;
}
.gallery-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 1.25rem var(--page);
  border: 0;
  background: rgba(5, 5, 5, 0.97);
  color: var(--fg);
  overflow: hidden;
}
.gallery-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1rem; }
.gallery-lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
.gallery-lightbox-bar,
.gallery-lightbox-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gallery-lightbox-bar { color: var(--muted); font-size: 0.78rem; }
.gallery-lightbox-stage { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.gallery-lightbox-stage img { width: 100%; height: 100%; object-fit: contain; }
.gallery-lightbox-controls { justify-content: flex-end; }
.gallery-lightbox-controls button {
  min-width: 3rem;
  min-height: 3rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: background 250ms ease, color 250ms ease;
}
.gallery-lightbox-controls button:hover,
.gallery-lightbox-controls button:focus-visible { background: var(--fg); color: var(--bg); }
body.gallery-open { overflow: hidden; }
.experience-link {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.5rem, 3.6vw, 4rem);
  letter-spacing: -0.045em;
  transition: padding 500ms cubic-bezier(.16, 1, .3, 1), background 350ms ease, color 350ms ease;
}
.experience-link span:nth-child(2) { color: var(--muted); font-size: 0.45em; letter-spacing: 0; }
.experience-link:hover,
.experience-link:focus-visible { padding-inline: 1.25rem; background: var(--fg); color: var(--bg); }
.category-page {
  min-height: 100dvh;
  padding: 8rem var(--page) 7rem;
}
.category-header { margin-bottom: clamp(5rem, 10vw, 10rem); }
.category-header-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.82rem; }
.category-header h1 { margin-top: 12vh; max-width: 12ch; font-size: clamp(4.2rem, 11vw, 11rem); font-weight: 500; letter-spacing: -0.075em; line-height: 0.88; }
.category-header h1 span { display: block; color: transparent; font-size: 0.46em; letter-spacing: -0.04em; -webkit-text-stroke: 1.2px var(--fg); }
.cover-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(4rem, 8vw, 9rem) var(--page); align-items: start; }
.cover-card:nth-child(3) { grid-column: 2; }
.cover-card-media { display: block; overflow: hidden; background: var(--surface); }
.cover-card-media img { aspect-ratio: 1.97 / 1; object-fit: cover; transition: transform 900ms cubic-bezier(.16, 1, .3, 1); }
.cover-card:hover .cover-card-media img,
.cover-card:focus-within .cover-card-media img { transform: scale(1.03); }
.cover-card-info { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; padding-top: 1rem; }
.cover-card-info h2 { font-size: clamp(1.45rem, 2.2vw, 2.4rem); font-weight: 500; letter-spacing: -0.045em; }
.cover-card-info p { grid-column: 1; color: var(--muted); }
.cover-card-info span { grid-column: 2; grid-row: 1 / 3; font-size: 1.2rem; }

.viewer-page { height: 100dvh; overflow: hidden; }
.viewer-shell { height: 100dvh; padding: 5.25rem var(--page) 1.2rem; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1rem; }
.viewer-head, .viewer-foot { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1.25rem; }
.viewer-head { min-height: 3rem; }
.viewer-title { font-size: clamp(1.25rem, 2.8vw, 2.8rem); font-weight: 500; letter-spacing: -0.045em; }
.viewer-category, .viewer-counter, .viewer-hint { color: var(--muted); font-size: 0.82rem; }
.viewer-track { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior-y: contain; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-frame { width: 100%; height: 100%; min-height: 100%; margin: 0 0 var(--page); display: flex; align-items: center; justify-content: center; scroll-snap-align: start; scroll-snap-stop: always; background: #080808; }
.viewer-frame img,
.viewer-frame video { width: 100%; height: 100%; object-fit: contain; }
.viewer-frame video { background: #000; }
.viewer-controls { display: flex; gap: 0.5rem; }
.viewer-controls button { width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--fg); font: inherit; cursor: pointer; transition: background 250ms ease, color 250ms ease; }
.viewer-controls button:hover,
.viewer-controls button:focus-visible { background: var(--fg); color: var(--bg); }
.viewer-controls button:active { transform: translateY(1px); }
.viewer-error { display: none; align-self: center; max-width: 30rem; font-size: 1.3rem; }

.reveal, .split-reveal { will-change: transform, opacity; }

@media (max-width: 767px) {
  :root { --page: 1rem; }
  .site-header { height: 60px; }
  .site-header nav { gap: 1rem; }
  .site-header nav a { font-size: 0.76rem; }
  .site-header nav .nav-profile { display: none; }
  .hero { padding-top: 4.5rem; grid-template-columns: 1fr; }
  .hero-meta p:last-child { display: none; }
  .hero-title { font-size: clamp(4.7rem, 23vw, 7.2rem); line-height: 0.82; }
  .hero-title .line-en { margin-top: 0.18em; font-size: 0.42em; text-align: left; letter-spacing: -0.04em; }
  .particle-hero { grid-template-rows: 1fr 0.78fr; }
  .particle-name-zh, .particle-name-en { width: 100%; margin-left: 0; }
  .particle-name-en .particle-text__fallback { justify-content: flex-start; }
  .hero-note { display: block; }
  .hero-note p:last-child { margin-top: 0.4rem; text-align: left; }
  .statement { min-height: 82dvh; padding: 8rem var(--page); grid-template-columns: 1fr; gap: 2.5rem; }
  .statement-zh { font-size: clamp(2.55rem, 12vw, 4.4rem); }
  .statement-en { align-self: start; }
  .work { padding: 5rem var(--page) 7rem; }
  .section-heading { margin-bottom: 2.5rem; }
  .section-heading h2 { font-size: 2.6rem; }
  .work-row { grid-template-columns: 1fr auto; gap: 0.6rem 1rem; min-height: 7.4rem; }
  .work-type { grid-column: 1 / -1; color: var(--muted); }
  .work-name { font-size: clamp(2rem, 10vw, 3.2rem); }
  .work-en { display: none; }
  .work-arrow { grid-column: 2; grid-row: 2; }
  .category-row { grid-template-columns: 1fr auto; }
  .category-row .work-thumb { grid-column: 1 / -1; grid-row: 3; margin-top: 0.75rem; }
  .project { margin-bottom: 6rem; }
  .project-one .project-media { margin-left: 0; }
  .project-two .project-media { width: 100%; }
  .project-info { grid-template-columns: 1fr auto; }
  .project-info > p:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .pending-projects { grid-template-columns: 1fr; gap: 0.7rem; }
  .profile { min-height: auto; padding: 7rem var(--page); gap: 7rem; }
  .profile-intro h2 { font-size: clamp(3rem, 13vw, 5.2rem); }
  .profile-en { margin-top: 2.5rem; }
  .profile-grid { grid-template-columns: 1fr; gap: 2.5rem; margin-left: 0; }
  .contact { min-height: 86dvh; padding-top: 5rem; }
  .contact-top { display: block; }
  .contact-top p:last-child { color: rgba(241, 240, 236, 0.7); }
  .contact h2 { font-size: clamp(4.2rem, 21vw, 7.5rem); line-height: 0.84; }
  .contact-details { grid-template-columns: 1fr; gap: 1rem; margin-left: 0; }
  .contact-details a { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  .detail-hero { padding-top: 4.5rem; }
  .detail-title { font-size: clamp(4rem, 18vw, 6.8rem); line-height: 0.86; }
  .detail-title-en { margin-top: 0.18em; text-align: left; font-size: 0.42em; }
  .detail-bottom { display: block; }
  .detail-bottom p:last-child { margin-top: 0.35rem; color: var(--muted); }
  .detail-copy { min-height: auto; padding: 7rem var(--page); gap: 6rem; }
  .detail-copy h2 { font-size: clamp(2.8rem, 12vw, 4.8rem); }
  .detail-copy-grid { grid-template-columns: 1fr; gap: 2.5rem; margin-left: 0; }
  .experience-project { padding: 6rem var(--page); }
  .experience-item { grid-template-columns: 2.5rem 1fr; gap: 1rem; }
  .experience-item p { grid-column: 2; }
  .internship-gallery { padding: 5rem var(--page) 7rem; }
  .internship-gallery-head { align-items: flex-start; margin-bottom: 4rem; }
  .internship-gallery-head h2 { font-size: clamp(3.4rem, 17vw, 5.6rem); }
  .internship-gallery-head > span { padding-top: 0.25rem; white-space: nowrap; }
  .drift-wall-shell { height: 74dvh; min-height: 520px; }
  .drift-wall-hint span:first-child { display: none; }
  .drift-wall-hint { justify-content: flex-end; }
  .gallery-lightbox { padding-block: 1rem; }
  .gallery-lightbox-controls button { min-height: 2.75rem; padding-inline: 0.8rem; font-size: 0.8rem; }
  .experience-link { grid-template-columns: 1fr auto; }
  .experience-link span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .experience-link span:last-child { grid-column: 2; grid-row: 1 / 3; }
  .category-page { padding-top: 6rem; }
  .category-header h1 { margin-top: 10vh; font-size: clamp(4rem, 18vw, 6.5rem); }
  .cover-grid { grid-template-columns: 1fr; gap: 4.5rem; }
  .cover-card:nth-child(3) { grid-column: auto; }
  .viewer-shell { padding-top: 4.25rem; }
  .viewer-head { grid-template-columns: 1fr auto; }
  .viewer-category { display: none; }
  .viewer-title { font-size: 1.2rem; }
  .viewer-frame { margin-bottom: 0.75rem; }
  .viewer-foot { grid-template-columns: 1fr auto; }
  .viewer-hint { max-width: 13rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .hero-title .line > span { transform: none; }
  .detail-title .line > span { transform: none; }
  .reveal, .split-reveal { opacity: 1 !important; transform: none !important; }
  .drift-wall__plane,
  .drift-wall__track { will-change: auto; }
}
