/* Layout: a full-screen photographic hero where the name sits between sky and ridge; below, quiet stone-grey sections built from content files */
:root {
  --bg: #e8e6e1;
  --ink: #1b1b1d;
  --muted: #6c6a65;
  --line: rgba(27, 27, 29, 0.14);
  --hero-ink: #ffffff;
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #141416; --ink: #ecebe6; --muted: #9a9892; --line: rgba(236, 235, 230, 0.14); color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #141416; --ink: #ecebe6; --muted: #9a9892; --line: rgba(236, 235, 230, 0.14); color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.hero { position: relative; height: 100svh; min-height: 520px; overflow: hidden; background: #1d2633; color: var(--hero-ink); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 16%, rgba(0,0,0,0) 72%, rgba(0,0,0,0.38) 100%); }
.layer { position: absolute; inset: -3%; will-change: transform; }
.layer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.1s ease; }
.layer img.on { opacity: 1; }
.back { z-index: 1; }
.front { z-index: 3; pointer-events: none; }
#nameSvg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.hero.over #nameSvg { z-index: 4; }
#nameT { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; fill: var(--hero-ink); transition: fill 1s ease; }

.nav { position: absolute; z-index: 6; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; transition: color 1s ease; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { text-decoration: none; opacity: 0.85; }
.nav a:hover, .nav a:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 4px; outline: none; }
.mark { letter-spacing: 0.4em; }
.nav .right { justify-self: end; }

.thumbs { position: absolute; z-index: 6; left: max(24px, env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.thumb { width: 44px; height: 44px; padding: 0; border-radius: 6px; border: 1px solid rgba(255,255,255,0.35); background-size: cover; background-position: center; cursor: pointer; opacity: 0.55; transition: opacity .3s, transform .3s, border-color .3s; }
.thumb:hover { opacity: 0.85; }
.thumb.on { opacity: 1; transform: scale(1.08); border-color: #fff; }
.thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.timer { position: absolute; z-index: 6; right: max(24px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); width: 2px; height: 120px; background: rgba(255,255,255,0.25); }
.timer i { position: absolute; left: 0; top: 0; width: 100%; height: 0; background: var(--hero-ink); transition: background 1s ease; }
.foot { color: #fff; position: absolute; z-index: 6; left: 0; right: 0; bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 14px)); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; text-align: center; padding-inline: 90px; }
.foot span { text-shadow: 0 1px 10px rgba(0,0,0,0.35); }
.foot a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.45); padding-bottom: 3px; transition: border-color .3s ease; }
.foot a:hover { border-bottom-color: #fff; }
.hero::after { transition: opacity 1s ease; }
.hero.plain::after { opacity: 0; }
.hero.plain .foot { color: var(--hero-ink); }
.hero.plain .foot span { text-shadow: none; }
.hero.plain .foot a { border-bottom-color: currentColor; }
.foot .chev { width: 10px; height: 10px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px) rotate(45deg); } }

main { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
section.block { max-width: 1240px; margin: 0 auto; padding-block: clamp(72px, 12vw, 140px) 0; scroll-margin-top: 24px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--ink); padding-bottom: 14px; margin-bottom: 8px; }
.head h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(56px, 10vw, 128px); line-height: 0.9; margin: 0; letter-spacing: -0.02em; }
.head .n { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }

.rows details, .rows .row { border-bottom: 1px solid var(--line); }
.rows summary, .rows .row a { list-style: none; cursor: pointer; display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 0.8fr) 28px; gap: 20px; align-items: baseline; padding: 22px 0; text-decoration: none; transition: padding .35s cubic-bezier(.2,.8,.2,1); }
.rows summary::-webkit-details-marker { display: none; }
.rows summary:hover, .rows .row a:hover { padding-left: 12px; }
.rows summary:focus-visible, .rows .row a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rows .yr { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.rows .yr .langs { display: block; margin-top: 6px; font-size: 11px; letter-spacing: 0.12em; opacity: 0.8; }
.rows .tt { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.2; }
.rows .tt:lang(zh-CN), .rows .tg:lang(zh-CN), .prose:lang(zh-CN) { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
.rows .tt:lang(zh-CN) { font-size: clamp(26px, 3.3vw, 42px); line-height: 1.3; font-weight: 500; }
.rows .tg:lang(zh-CN), .prose:lang(zh-CN) { line-height: 1.75; }
.rows .tg { font-size: 13px; color: var(--muted); }
.rows .pl { justify-self: end; font-size: 18px; transition: transform .3s ease; }
.rows details[open] .pl { transform: rotate(45deg); }
.rows .body { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 0.8fr) 28px; gap: 20px; padding: 0 0 26px; }
.rows .body .prose { grid-column: 2 / 4; max-width: 62ch; }
.rows .body .prose > :first-child { margin-top: 0; }
.rows .body .label { grid-column: 2 / 4; }
.lib .body .yt, .lib .body .yt-frame { grid-column: 2 / 4; position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; padding: 0; overflow: hidden; background: #111; cursor: pointer; display: block; margin-bottom: 18px; }
.lib .body .yt img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease, opacity .3s ease; opacity: 0.92; }
.lib .body .yt:hover img { transform: scale(1.03); opacity: 1; }
.lib .body .yt:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.lib .play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(255,255,255,0.88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lib .play::after { content: ""; position: absolute; left: 26px; top: 21px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #111; }
.lib-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.lib-meta a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.lib-meta a:hover, .lib-meta a:focus-visible { border-color: var(--ink); outline: none; }
.rows .empty { padding: 22px 0; color: var(--muted); }

.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 860px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 24px 0 8px; scrollbar-width: thin; }
.gallery figure { margin: 0; scroll-snap-align: start; display: grid; gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; display: block; }
.gallery figcaption { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.cv { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px 48px; padding-top: 28px; }
.cv h3 { margin: 0 0 14px; font-weight: 400; }
.cv dl { margin: 0; display: grid; gap: 16px; }
.cv dt { font-weight: 500; display: flex; justify-content: space-between; gap: 12px; }
.cv dt span { font-weight: 400; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv-pages { display: grid; gap: 28px; max-width: 920px; margin: 0 auto; padding-top: 36px; }
.cv-page { position: relative; width: 100%; background: #fff; border-radius: 3px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 18px 48px rgba(0,0,0,0.22); }
.cv-page canvas { display: block; width: 100%; height: 100%; }
.cv-page a { position: absolute; display: block; border-radius: 2px; }
.cv-page a:hover, .cv-page a:focus-visible { background: rgba(156, 95, 67, 0.14); outline: none; }
.cv dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 999px; font-size: 12px; letter-spacing: 0.14em; text-decoration: none; text-transform: uppercase; }
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--bg); outline: none; }

footer { max-width: 1240px; margin: clamp(80px, 12vw, 140px) auto 0; padding-block: 28px max(28px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
footer .contact { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
footer button { font: inherit; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

.prose { font-size: 17px; line-height: 1.7; }
.prose h2, .prose h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
.prose h2 { font-size: 34px; margin: 1.6em 0 0.4em; }
.prose h3 { font-size: 26px; margin: 1.4em 0 0.3em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose blockquote { margin: 1.4em 0; padding-left: 1.2em; border-left: 1px solid var(--ink); font-family: var(--font-display); font-size: 1.35em; line-height: 1.4; font-style: italic; }
.prose img { border-radius: 4px; display: block; margin: 1.6em 0; }
.prose code { font-size: 0.9em; }
.prose pre { overflow-x: auto; padding: 16px; background: rgba(127,127,127,0.1); border-radius: 6px; }

/* Field hero: live simulations of classic models of emergence behind a fixed statement */
.hero.field { background: #04060c; --fld-accent: #52f2ff; }
.hero.field::after { background: linear-gradient(180deg, rgba(4,6,12,0.55) 0%, rgba(4,6,12,0) 14%, rgba(4,6,12,0) 62%, rgba(4,6,12,0.7) 100%); }
.hero.field .layer, .hero.field #nameSvg, .hero.field .thumbs, .hero.field .timer, .hero.field #caption { display: none; }
.hero.field .nav .mark { visibility: hidden; }
.fld-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
.fld-txt { position: absolute; z-index: 6; left: max(40px, env(safe-area-inset-left, 0px)); bottom: max(96px, calc(env(safe-area-inset-bottom, 0px) + 84px)); max-width: min(560px, 46vw); pointer-events: none; }
.fld-name { font-family: var(--font-display); font-weight: 500; font-size: clamp(52px, 7vw, 104px); line-height: 0.95; letter-spacing: -0.02em; }
.fld-line { margin-top: 18px; font-family: var(--font-display); font-style: italic; font-size: clamp(20px, 2vw, 27px); line-height: 1.3; color: rgba(255,255,255,0.88); }
.fld-keys { margin-top: 16px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.fld-keys span { color: var(--fld-accent); transition: color 1s ease; }
.fld-card { position: absolute; z-index: 6; top: max(76px, calc(env(safe-area-inset-top, 0px) + 64px)); right: max(24px, env(safe-area-inset-right, 0px)); width: 280px; padding-left: 14px; border-left: 1px solid var(--fld-accent); transition: opacity .7s ease, transform .7s ease, border-color 1s ease; pointer-events: none; }
.fld-card.fld-out { opacity: 0; transform: translateY(-6px); }
.fld-f { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fld-accent); }
.fld-t { margin-top: 6px; font-family: var(--font-display); font-size: 28px; line-height: 1.05; }
.fld-r { margin-top: 4px; font-family: var(--font-display); font-style: italic; font-size: 14px; color: rgba(255,255,255,0.6); }
.fld-u { margin-top: 10px; font-size: 12.5px; line-height: 1.55; color: rgba(255,255,255,0.75); }
.fld-v { margin-top: 10px; font-size: 11px; letter-spacing: 0.04em; line-height: 1.7; color: rgba(255,255,255,0.55); font-variant-numeric: tabular-nums; }
.fld-v b { font-weight: 500; color: #fff; }
.fld-ctl { position: absolute; z-index: 6; right: max(24px, env(safe-area-inset-right, 0px)); bottom: max(26px, calc(env(safe-area-inset-bottom, 0px) + 18px)); display: flex; gap: 18px; }
.fld-ctl button { background: none; border: 0; padding: 4px 0; color: rgba(255,255,255,0.7); font: inherit; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.3); }
.fld-ctl button:hover, .fld-ctl button:focus-visible { color: #fff; border-bottom-color: var(--fld-accent); outline: none; }

@media (max-width: 720px) {
  .fld-txt { left: 24px; right: 24px; max-width: none; bottom: max(84px, calc(env(safe-area-inset-bottom, 0px) + 72px)); }
  .fld-card { display: none; }
  .fld-ctl { left: 24px; right: auto; bottom: max(26px, calc(env(safe-area-inset-bottom, 0px) + 18px)); }
}
@media (max-width: 720px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav .mark { display: none; }
  .nav ul { gap: 12px; flex-wrap: nowrap; }
  .nav { font-size: 11px; letter-spacing: 0.08em; }
  .thumbs { top: auto; transform: none; bottom: max(64px, calc(env(safe-area-inset-bottom, 0px) + 56px)); flex-direction: row; left: 50%; translate: -50% 0; }
  .timer { display: none; }
  .foot { padding-inline: 24px; }
  .rows summary, .rows .row a, .rows .body { grid-template-columns: 64px minmax(0, 1fr) 22px; gap: 12px; }
  .rows .tg { grid-column: 2; grid-row: 2; }
  .rows .pl { grid-column: 3; grid-row: 1; }
  .rows .body .prose, .rows .body .label, .lib .body .yt, .lib .body .yt-frame { grid-column: 1 / 4; }
  .nav .right { display: none; }
}
@media (prefers-reduced-motion: reduce) { .foot .chev { animation: none; } }

/* Research overview figures must remain fully visible in the slideshow. */
.layer img.contain { object-fit: contain; background: #fff; }
