/* 想换配色 / 字体，改这里即可 */
:root {
  --bg: #f7f6f3;
  --fg: #121212;
  --muted: #8a8780;
  --line: #dcd9d2;
  --pad: clamp(18px, 3.2vw, 48px);
  --sans: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--fg);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; text-transform: uppercase; }
.wrap { padding-left: var(--pad); padding-right: var(--pad); }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.brand { font-weight: 600; letter-spacing: -.01em; font-size: 16px; }
.nav { display: flex; gap: clamp(16px, 2.4vw, 36px); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.nav a { color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a.active { color: var(--fg); }

/* ---------- home ---------- */
.hero { display: block; position: relative; margin: 0 var(--pad); overflow: hidden; background: var(--line); }
.hero img { height: min(78vh, 62vw); object-fit: cover; transition: transform 1.2s ease; }
@media (max-width: 600px) and (orientation: portrait) { .hero img.has-tall { height: auto; aspect-ratio: 4 / 5; } }
.hero:hover img { transform: scale(1.015); }
.hero-cap { display: flex; justify-content: space-between; gap: 16px; padding-top: 10px; }

.statement {
  padding-top: clamp(56px, 10vw, 150px); padding-bottom: clamp(56px, 9vw, 130px);
  display: grid; grid-template-columns: 1fr 3fr; gap: 24px;
}
.statement p {
  font-size: clamp(26px, 3.4vw, 50px); line-height: 1.14; letter-spacing: -.02em; max-width: 21em;
}
.statement p .muted { color: var(--muted); }
@media (max-width: 760px) { .statement { grid-template-columns: 1fr; } }

.index-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px; border-bottom: 1px solid var(--fg);
}
.index-head h2 { font-size: 15px; font-weight: 500; }
.controls { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.controls .group { display: flex; gap: 12px; }
.controls button { color: var(--muted); }
.controls button.on { color: var(--fg); }
.controls button sup { font-size: 9px; margin-left: 1px; }
@media (max-width: 760px) {
  .index-head { flex-direction: column; gap: 12px; }
  .controls { justify-content: space-between; width: 100%; }
  .controls .group { flex-wrap: wrap; gap: 6px 12px; }
}

/* list view */
.index { list-style: none; margin-bottom: clamp(60px, 10vw, 140px); }
.row {
  display: grid; grid-template-columns: 52px 2.2fr 2fr 1.2fr 70px; gap: 16px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  transition: padding .35s ease, color .2s;
}
.row .t { font-size: clamp(18px, 1.8vw, 26px); letter-spacing: -.01em; }
.row .y { text-align: right; }
.index:hover .row { color: var(--muted); }
.index .row:hover { color: var(--fg); padding-left: 10px; }
@media (max-width: 760px) {
  .row { grid-template-columns: 36px 1fr auto; }
  .row .ty, .row .st { display: none; }
}

/* grid view */
.grid {
  display: grid; gap: clamp(36px, 4vw, 64px) clamp(16px, 2vw, 28px);
  grid-template-columns: repeat(3, 1fr); padding-top: 28px;
  margin-bottom: clamp(60px, 10vw, 140px);
}
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .grid { grid-template-columns: 1fr; } }
.card .thumb { overflow: hidden; aspect-ratio: 4 / 3; background: var(--line); }
.card .thumb img { height: 100%; object-fit: cover; transition: transform .8s ease; }
.card:hover .thumb img { transform: scale(1.04); }
.card .cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.card .cap .t { font-size: 17px; }

/* cursor preview (desktop only) */
.preview {
  position: fixed; left: 0; top: 0; z-index: 15; width: 340px; pointer-events: none;
  opacity: 0; transform: translate(32px, -50%) scale(.96); transition: opacity .25s, transform .25s;
}
.preview.show { opacity: 1; transform: translate(32px, -50%); }
.preview img { aspect-ratio: 4 / 3; object-fit: cover; box-shadow: 0 20px 50px rgba(0,0,0,.15); }
@media (hover: none) { .preview { display: none; } }

/* ---------- project ---------- */
.p-hero { margin: 0 var(--pad); cursor: zoom-in; }
.p-hero img { max-height: 86vh; width: auto; max-width: 100%; margin: 0 auto; }
/* heroPos 项目：顶图与首页大图同尺寸，裁切位置由 heroPos 决定 */
.p-hero.wide img { width: 100%; height: min(78vh, 62vw); max-height: none; object-fit: cover; object-position: var(--pos); }
@media (max-width: 600px) and (orientation: portrait) { .p-hero.wide img.has-tall { height: auto; aspect-ratio: 4 / 5; } }
.p-head {
  display: grid; grid-template-columns: 2fr 1fr; gap: 32px;
  padding-top: clamp(32px, 5vw, 72px); padding-bottom: clamp(32px, 5vw, 64px);
}
.p-head h1 { font-size: clamp(36px, 6vw, 92px); font-weight: 400; line-height: 1; letter-spacing: -.035em; }
.p-head .sub { margin-top: 14px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; align-content: end; border-top: 1px solid var(--line); padding-top: 14px; }
.facts dt { color: var(--muted); }
.p-text { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; padding-bottom: clamp(40px, 7vw, 100px); }
.p-text .body p { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; max-width: 36em; }
.p-text .body p + p { margin-top: 1em; }
@media (max-width: 760px) { .p-head, .p-text { grid-template-columns: 1fr; } }

.gallery { display: flex; flex-wrap: wrap; gap: clamp(12px, 1.6vw, 24px); }
.gallery figure { flex: 1 1 100%; cursor: zoom-in; }
.gallery figure.half { flex: 1 1 calc(50% - 12px); }
.gallery figure.full img { max-height: 92vh; width: auto; max-width: 100%; margin: 0 auto; }
.gallery figure.half img { height: 100%; max-height: 92vh; object-fit: contain; }
.gallery figure.video { cursor: default; }
.gallery video { display: block; width: auto; max-width: 100%; max-height: 92vh; margin: 0 auto; background: var(--line); }
.gallery figure.third { flex: 1 1 calc(33.333% - 18px); min-width: 0; }
.gallery figure.blend img, .gallery figure.blend video { mix-blend-mode: multiply; background: none; }
@media (max-width: 600px) { .gallery figure.half, .gallery figure.third { flex-basis: 100%; } }
.gallery figcaption { margin-top: 8px; color: var(--muted); }
.gallery figure.full figcaption, .gallery figure.half figcaption, .gallery figure.third figcaption, .gallery figure.third.video figcaption { text-align: center; }
/* 对齐的一行 */
.g-row { flex: 0 0 100%; display: flex; gap: clamp(12px, 1.6vw, 24px); align-items: flex-start; }
.gallery .g-row figure, .g-row .g-gap { flex: var(--r) 1 0; min-width: 0; }
.gallery .g-row figure img { width: 100%; height: auto; aspect-ratio: var(--r); object-fit: cover; }
.gallery .g-row figure.contain img { object-fit: contain; }
.gallery .g-row figcaption { text-align: center; }
/* 图片下方的说明文字（有 note 时图注左对齐） */
.gallery .g-row figure:has(.g-note) figcaption { text-align: left; color: var(--fg); margin-top: 12px; }
.g-note { margin: 4px 0 clamp(12px, 1.6vw, 24px); font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 40em; }
/* fitScreen 项目：小标题和文字在左、图在右；每组图片一屏内看完 */
.g-part { flex: 0 0 100%; border-top: 1px solid var(--line); padding-top: 16px; margin-top: clamp(40px, 5vw, 80px); }
.g-part:first-child { margin-top: 0; }
.g-side h2 { font-weight: 400; color: var(--muted); }
.g-side p { margin-top: 14px; font-size: 15px; line-height: 1.55; max-width: 36em; }
.g-body { display: flex; flex-wrap: wrap; gap: clamp(12px, 1.6vw, 24px); min-width: 0; margin-top: 24px; }
@media (min-width: 1000px) {
  .g-part { --side: clamp(200px, 17vw, 280px); --sgap: clamp(32px, 4vw, 72px); --s: calc(var(--side) + var(--sgap)); display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: var(--sgap); }
  /* 项目简介：左右留同样宽的栏，正文以整页居中 */
  .p-text.fit-screen { --side: clamp(200px, 17vw, 280px); grid-template-columns: var(--side) minmax(0, 1fr) var(--side); gap: clamp(32px, 4vw, 72px); }
  .p-text.fit-screen .body { width: 100%; max-width: 1000px; margin-inline: auto; }
  .p-text.fit-screen .body p { max-width: none; }
  .g-side { position: sticky; top: 80px; align-self: start; }
  .g-body { margin-top: 0; }
}
@media (min-width: 761px) {
  .fit-screen { --room: clamp(320px, calc(100svh - 240px), 760px); --gap: clamp(12px, 1.6vw, 24px); }
  .fit-screen .g-body { row-gap: clamp(56px, 6vw, 96px); }
  /* 图片以整页居中（--s 为左栏宽度），放不下时才贴着左栏 */
  .g-body > .g-row { --w: calc(var(--room) * var(--sum) + var(--gap) * var(--n)); }
  .g-body > .g-split { --w: calc(var(--room) * var(--fit, 99) + 56px); }
  .g-body > .g-row, .g-body > .g-split { --left: max(0px, calc((100% - var(--s, 0px) - var(--w)) / 2)); padding-left: var(--left); padding-right: max(0px, calc(100% - var(--w) - var(--left))); }
  .gallery .g-body > .g-row > figure:only-child { flex-grow: 1; }
  .g-body > .tall { --room: max(320px, calc(100svh - 130px)); }
  .g-body > .g-split.tall, .g-body > .stage { align-items: stretch; }
  .g-split.tall > .g-col:last-child { flex-flow: column nowrap; justify-content: space-between; gap: 0; }
  .gallery .g-split.tall > .g-col:last-child > figure { flex: none; }
  .stage > .g-col:last-child { flex-flow: column nowrap; }
  .stage > .g-col:last-child > * { flex: none; }
  .stage > .g-col:last-child > .g-row { margin-top: auto; }
}
@media (max-width: 760px) { .g-body > .stage { margin-bottom: 32px; } .gallery .g-body .g-col:has(> figure:nth-child(4)) > figure { flex: 0 0 calc(50% - 6px); } }
/* 大屏：最宽的图也收到能整页居中的宽度 */
@media (min-width: 1800px) { .g-body > .g-row, .g-body > .g-split { --left: max(0px, calc((100% - var(--s) - min(var(--w), 100% - var(--s))) / 2)); padding-right: calc(var(--left) + var(--s)); } }
.stage .g-label { color: var(--fg); margin-bottom: -8px; }
.stage .g-note { flex: 0 0 100%; margin: 0; }
/* 左右分栏 */
.g-split { flex: 0 0 100%; display: grid; grid-template-columns: var(--cols); gap: clamp(24px, 3.2vw, 56px); align-items: start; }
.g-col { display: flex; flex-wrap: wrap; gap: clamp(12px, 1.6vw, 24px); min-width: 0; }
.gallery .g-col > figure.full img { width: 100%; max-height: none; }
.g-label { flex: 0 0 100%; font-weight: 400; color: var(--muted); }
.g-label:not(:first-child) { margin-top: clamp(8px, 1.4vw, 20px); }
.p-quote { font-size: clamp(20px, 2vw, 30px); line-height: 1.3; letter-spacing: -.01em; font-style: italic; color: var(--muted); padding-bottom: clamp(28px, 4vw, 56px); }
@media (max-width: 760px) { .g-split { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .g-row:not(.keep) { flex-wrap: wrap; } .gallery .g-row:not(.keep) figure { flex: 0 0 100%; } }
/* 章节 */
.g-sec {
  flex: 0 0 100%; display: grid; grid-template-columns: 1fr 2fr; gap: 20px 32px; align-items: start;
  border-top: 1px solid var(--line); padding: 16px 0 clamp(16px, 2.4vw, 36px);
  margin-top: clamp(40px, 6vw, 96px);
}
.g-sec:first-child { margin-top: 0; }
.g-sec h2 { font-weight: 400; color: var(--muted); }
.g-sec .body p { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; max-width: 36em; }
.g-sec .body p + p { margin-top: 1em; }
.g-sec.has-aside { grid-template-columns: 3fr 4.5fr 1.5fr; }
.gallery .g-sec figure video { max-height: 60vh; }
@media (max-width: 760px) {
  .g-sec, .g-sec.has-aside { grid-template-columns: 1fr; }
  .gallery .g-sec figure video { max-height: 38vh; }
}

.next { display: block; margin-top: clamp(80px, 12vw, 180px); border-top: 1px solid var(--fg); padding-top: 16px; padding-bottom: clamp(40px, 6vw, 80px); }
.next .t { display: block; font-size: clamp(40px, 8vw, 130px); line-height: 1; letter-spacing: -.04em; margin-top: 18px; transition: transform .4s ease; }
.next:hover .t { transform: translateX(14px); }

/* ---------- photography ---------- */
.page-head { display: flex; justify-content: space-between; align-items: baseline; padding-top: clamp(40px, 7vw, 100px); padding-bottom: 14px; border-bottom: 1px solid var(--fg); margin-bottom: 28px; }
.page-head h1 { font-size: clamp(36px, 6vw, 92px); font-weight: 400; line-height: 1; letter-spacing: -.035em; }
.masonry { columns: 3 300px; column-gap: clamp(12px, 1.6vw, 24px); margin-bottom: clamp(60px, 10vw, 140px); }
.masonry figure { break-inside: avoid; margin-bottom: clamp(12px, 1.6vw, 24px); cursor: zoom-in; }
.masonry figcaption { margin-top: 6px; color: var(--muted); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); padding-top: clamp(40px, 7vw, 100px); padding-bottom: clamp(60px, 10vw, 140px); }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }
.about h1 { font-size: clamp(36px, 6vw, 92px); font-weight: 400; line-height: 1; letter-spacing: -.035em; }
.about .portrait { margin-top: 32px; max-width: 420px; }
.about .bio p { font-size: clamp(17px, 1.5vw, 22px); line-height: 1.45; letter-spacing: -.005em; }
.about .bio p + p { margin-top: 1em; }
.about h2 { margin: 48px 0 10px; color: var(--muted); font-weight: 400; }
.cv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.cv dt { color: var(--muted); }
.links a { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.links a:hover { padding-left: 6px; transition: padding .25s; }

/* ---------- footer ---------- */
.site-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px var(--pad) 28px; border-top: 1px solid var(--line); color: var(--muted);
}
.site-footer a:hover { color: var(--fg); }
.site-footer .r { display: flex; gap: 24px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: #0e0e0e; color: #eee; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 88vw; max-height: 84vh; width: auto; object-fit: contain; }
.lightbox figcaption { margin-top: 12px; color: #888; font-family: var(--mono); font-size: 12px; text-transform: uppercase; }
.lightbox button { position: absolute; color: #aaa; font-family: var(--mono); font-size: 13px; text-transform: uppercase; padding: 16px; }
.lightbox button:hover { color: #fff; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); font-size: 22px !important; }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); font-size: 22px !important; }

.fade { animation: fade .6s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 密码页 ---------- */
.lock { max-width: 640px; padding-top: clamp(40px, 6vw, 96px); padding-bottom: clamp(60px, 10vw, 140px); }
.lock h1 { font-size: clamp(36px, 6vw, 92px); font-weight: 400; line-height: 1; letter-spacing: -.035em; margin: 14px 0 24px; }
.lock p { margin-top: 12px; }
.lock-form { display: flex; gap: 12px; margin-top: 28px; border-bottom: 1px solid var(--fg); }
.lock-form input { flex: 1; min-width: 0; font: inherit; font-size: 18px; padding: 12px 0; background: none; border: 0; outline: none; color: var(--fg); }
.lock-form button { padding: 0 4px; }
.lock-form button:hover { color: var(--muted); }
.lock a { text-decoration: underline; text-underline-offset: 3px; }