:root {
  color-scheme: dark;
  --bg: #0a1117;
  --fg: #e8e7df;
  --soft: #c0cccc;
  --muted: #91a2a5;
  --line: #2a393e;
  --accent: #c8b88e;
  --serif: Georgia, "Songti SC", "Noto Serif SC", serif;
  --header-bg: rgba(10, 17, 23, .94);
  --header-card: rgba(24, 40, 46, .6);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1ef;
  --fg: #161616;
  --soft: #263230;
  --muted: #64746d;
  --line: rgba(0, 0, 0, .1);
  --accent: #7c6536;
  --header-bg: rgba(245, 241, 234, .96);
  --header-card: rgba(255, 255, 255, .5);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.9 "Helvetica Neue", Helvetica, Arial, sans-serif; isolation: isolate; }
main, .footer { position: relative; z-index: 1; }
.ambient-flow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: radial-gradient(ellipse at 88% 16%, rgba(70, 106, 128, .15), transparent 54%), radial-gradient(ellipse at 0 86%, rgba(35, 68, 89, .16), transparent 48%); }
.ambient-flow canvas { display: block; width: 100%; height: 100%; }
html[data-theme="light"] .ambient-flow { background: radial-gradient(ellipse at 88% 16%, rgba(137, 168, 178, .15), transparent 54%), radial-gradient(ellipse at 0 86%, rgba(125, 153, 165, .11), transparent 48%); }
a { color: inherit; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
button { font: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
html[data-lang="en"] [data-copy="zh"], html[data-lang="zh"] [data-copy="en"] { display: none !important; }
.skip { position: absolute; top: -100px; left: 24px; }
.skip:focus { top: 12px; z-index: 200; padding: 10px; background: var(--bg); }
.site-header { position: sticky; top: 0; z-index: 100; background: var(--header-bg); border-bottom: 1px solid var(--line); box-shadow: 0 10px 24px rgba(10, 32, 36, .08); }
.nav-container { position: relative; width: min(1200px, 100% - 3rem); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: .85rem; }
.site-header a { text-decoration: none; }
.logo a { display: inline-block; font-size: .85rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; padding: .35rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--header-card); white-space: nowrap; }
.logo a:hover { border-color: var(--accent); }
.nav-desktop { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: .25rem; font-size: .88rem; }
.nav-desktop a { color: var(--muted); padding: .5rem 1rem; border-radius: 999px; }
.nav-desktop a:hover { color: var(--fg); background: var(--header-card); }
.nav-controls { display: flex; align-items: center; gap: .5rem; }
.theme-toggle, .nav-toggle { position: relative; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 999px; flex: 0 0 auto; }
.theme-toggle:hover, .nav-toggle:hover { color: var(--fg); background: var(--header-card); }
.theme-toggle svg { position: absolute; inset: 11px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.nav-toggle { display: none; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border-radius: 8px; }
.hamburger-line { width: 20px; height: 2px; background: var(--fg); border-radius: 999px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-mobile { position: absolute; top: calc(100% + .4rem); left: 1rem; right: 1rem; padding: 1rem 0; border: 1px solid var(--line); border-radius: 1.35rem; background: var(--header-bg); box-shadow: 0 16px 34px rgba(0, 0, 0, .14); max-height: calc(100dvh - 90px); overflow-y: auto; }
.nav-mobile[hidden] { display: none; }
.nav-mobile nav { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.nav-mobile a { font-size: 1.1rem; padding: .75rem 1.5rem; border-radius: 999px; }
.nav-mobile a:hover { background: var(--header-card); }
.language { display: flex; gap: 3px; }
.language button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 5px 9px; }
.language button[aria-pressed="true"] { color: var(--fg); border-bottom: 1px solid var(--accent); }
.masthead, .hero, .layout { max-width: 1280px; margin: auto; padding-left: 32px; padding-right: 32px; }
.masthead { padding-top: 3rem; padding-bottom: 2.5rem; }
.breadcrumb { margin-bottom: 2rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 0; margin: 0; list-style: none; font-size: .72rem; letter-spacing: .06em; color: var(--muted); }
.breadcrumb li { display: flex; align-items: center; gap: .5rem; }
.breadcrumb li:not(:last-child)::after { content: "·"; }
.breadcrumb a { text-decoration: none; }
.breadcrumb [aria-current="page"] { color: var(--soft); font-weight: 500; }
.work-meta-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .82rem; color: var(--muted); margin-bottom: 1.5rem; }
.work-meta-row time { color: var(--accent); font-weight: 500; }
.eyebrow, .toc-label { color: var(--accent); font-size: 10px; letter-spacing: .17em; text-transform: uppercase; }
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); line-height: 1.2; font-weight: 300; letter-spacing: .28em; text-transform: uppercase; margin: .4rem 0 1.4rem; }
.dek { font: 400 1.3rem/1.5 var(--serif); max-width: 850px; margin: 0 0 20px; }
.meta { display: flex; gap: 8px 25px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin-top: 25px; }
.open-link { display: inline-flex; align-items: center; gap: 28px; text-decoration: none; border-bottom: 1px solid var(--accent); padding: 6px 0; font-size: 13px; color: var(--accent); }
figure { margin: 34px 0; }
.hero figure { margin: 0; }
img { display: block; width: 100%; height: auto; background: #050a0e; }
.hero img { height: auto; aspect-ratio: 16/9; object-fit: contain; }
.work-actions { display: flex; gap: 28px; flex-wrap: wrap; }
video { display: block; width: 100%; height: auto; background: #030811; }
.image-pair.final-gallery img { aspect-ratio: 16/9; object-fit: contain; }
.image-link { display: block; }
.image-link:hover { outline: 1px solid var(--muted); outline-offset: 4px; }
figcaption { margin-top: 11px; font-size: 11px; line-height: 1.75; color: var(--muted); }
.layout { padding-top: 45px; padding-bottom: 80px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 70px; }
.toc { position: sticky; top: 100px; align-self: start; padding-top: 23px; }
.toc-label { margin-bottom: 17px; }
.toc a { display: flex; gap: 13px; padding: 8px 0; color: var(--muted); text-decoration: none; line-height: 1.6; font-size: 12px; }
.toc a:hover { color: var(--fg); }
.toc a span:first-child { color: var(--accent); font-size: 10px; padding-top: 2px; }
.chapter { border-bottom: 1px solid var(--line); padding: 22px 0 44px; margin-bottom: 24px; }
.number { font-size: 11px; color: var(--accent); letter-spacing: .1em; }
h2 { font: 400 clamp(1.8rem, 3.1vw, 2.45rem)/1.3 var(--serif); margin: 12px 0 25px; letter-spacing: -.02em; }
h3 { font: 400 1.28rem/1.5 var(--serif); margin: 30px 0 13px; }
p { color: var(--soft); margin: 0 0 22px; max-width: 760px; text-wrap: pretty; }
[lang="zh-CN"] { line-height: 2; }
.lead { font-size: 18px; line-height: 1.85; color: var(--fg); }
.note { margin: 30px 0; padding: 8px 0 8px 23px; border-left: 1px solid var(--accent); }
.note p { margin: 0; font: 19px/1.8 var(--serif); color: var(--fg); }
.reference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 32px 0; align-items: start; }
.reference-grid figure { margin: 0; }
.reference-grid img { height: 350px; object-fit: contain; object-position: top center; }
.reference-grid b { display: block; color: var(--fg); font-weight: 400; margin-bottom: 6px; }
.image-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 32px 0; }
.image-pair figure { margin: 0; }
.image-pair img { aspect-ratio: 16/10; object-fit: cover; }
.image-pair.current img { aspect-ratio: auto; object-fit: contain; }
.stage-list { padding: 0; margin: 30px 0; list-style: none; }
.stage-list li { display: grid; grid-template-columns: 90px 1fr; gap: 20px; border-top: 1px solid var(--line); padding: 20px 0; }
.stage-list li:last-child { border-bottom: 1px solid var(--line); }
.stage-name { font-size: 12px; color: var(--accent); letter-spacing: .08em; }
.stage-list p { margin: 0; font-size: 14px; }
.stage-list em { font: 17px/1.55 var(--serif); color: var(--fg); display: block; margin-bottom: 7px; }
.shadow-figure { --muted: #91a2a5; border: 1px solid var(--line); padding: 22px; margin: 30px 0; background: #111d22; }
.shadow-figure svg { width: 100%; height: auto; display: block; }
.shadow-figure text { font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif; fill: var(--muted); }
.shadow-figure .small { font-size: 10px; }
.shadow-figure figcaption { max-width: 700px; }
.process-list { counter-reset: step; list-style: none; padding: 0; margin: 25px 0 0; }
.process-list li { counter-increment: step; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 20px; border-top: 1px solid var(--line); padding: 23px 0; }
.process-list li::before { content: counter(step, decimal-leading-zero); font-size: 20px; font-weight: 300; line-height: 1.5; color: var(--accent); }
.process-list p { margin: 0; font-size: 14px; }
.date-line { font-size: 11px; color: var(--accent); letter-spacing: .08em; margin-bottom: 24px; }
.code-note { font-size: 13px; }
code, kbd { font: .87em ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--fg); }
kbd { border: 1px solid var(--line); padding: 2px 5px; border-radius: 2px; white-space: nowrap; }
.live-frame { background: #030811; border: 1px solid var(--line); aspect-ratio: 16/10; display: grid; place-items: center; margin: 28px 0 15px; }
.live-frame iframe { width: 100%; height: 100%; border: 0; }
.live-frame button { border: 1px solid #c8b88e; color: #c8b88e; background: #0f1619; padding: 12px 22px; font-size: 13px; }
.live-note { font-size: 12px; color: var(--muted); }
.sources { margin: 25px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.sources li { margin-bottom: 12px; padding-left: 5px; }
.sources span { display: block; margin-top: 3px; }
.credits { font-size: 12px; color: var(--muted); margin-top: 30px; }
.credits dt { margin-top: 20px; color: var(--accent); }
.credits dd { margin: 4px 0 0; }
.footer { max-width: 1216px; margin: auto; padding: 25px 0 45px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 25px; font-size: 11px; color: var(--muted); }
.footer a { text-decoration: none; }
@media (min-width: 1500px) {
  .wide { width: calc(100% + 95px); margin-left: -48px; }
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 20px; }
  .toc { position: static; display: flex; gap: 8px 22px; flex-wrap: wrap; padding: 0 0 22px; border-bottom: 1px solid var(--line); }
  .toc-label { width: 100%; margin: 0; }
  .toc a { padding: 2px 0; }
  .chapter p { max-width: none; }
  .footer { margin: 0 32px; }
  .reference-grid img { height: 310px; }
}
@media (max-width: 600px) {
  .logo a { letter-spacing: .12em; padding: .3rem .7rem; font-size: .8rem; }
  .nav-controls { gap: .25rem; }
  .language button { padding: 5px 7px; }
  .masthead, .hero, .layout { padding-left: 20px; padding-right: 20px; }
  .masthead { padding-top: 42px; }
  h1 { font-size: 2rem; }
  .dek { font-size: 1.15rem; }
  .meta { gap: 4px 18px; }
  .hero img { height: auto; object-fit: contain; }
  .layout { padding-top: 28px; }
  .chapter { padding-bottom: 26px; }
  .chapter p { font-size: 14px; }
  .chapter .lead { font-size: 17px; }
  .reference-grid { grid-template-columns: 1fr; gap: 27px; }
  .reference-grid figure { display: grid; grid-template-columns: 42% 1fr; gap: 17px; }
  .reference-grid img { height: auto; }
  .reference-grid figcaption { margin-top: 0; }
  .image-pair { grid-template-columns: 1fr; gap: 26px; }
  .stage-list li { grid-template-columns: 58px 1fr; gap: 16px; }
  .shadow-figure { padding: 12px; }
  .process-list li { gap: 12px; grid-template-columns: 30px 1fr; }
  .footer { margin: 0 20px; flex-wrap: wrap; }
}
@media (max-width: 768px) {
  .nav-container { width: calc(100% - 2rem); }
  .nav-desktop { display: none; }
  .nav-toggle { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  .site-header, .toc, .open-link, .live-frame, .footer, .ambient-flow { display: none; }
  body { background: white; color: black; }
  :root { --fg: #111; --soft: #222; --muted: #555; --accent: #444; --line: #ccc; }
  .layout { display: block; }
  figure { break-inside: avoid; }
  .chapter { break-inside: auto; }
}
/* Remains keeps the process-page reading structure and its own complete frame. */
.hero img{height:auto;max-height:72vh;object-fit:contain;background:#080b10}
.work-title{font-family:var(--serif);letter-spacing:.015em}
html[data-lang=zh] .work-title{letter-spacing:.12em}
.image-pair img{object-fit:contain;background:#080b10}
.live-frame{background:#080b10}
.video-record{width:100%;display:block;background:#080b10;border:1px solid var(--line)}
@media(max-width:600px){.live-frame{aspect-ratio:3/4}.hero img{max-height:none}}
@view-transition{navigation:auto}
.hero figure{view-transition-name:work-hero}
.reference-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin:25px 0 35px;align-items:start}
.reference-gallery figure{margin:0;min-width:0}
.reference-gallery img{width:100%;height:auto;object-fit:contain;background:#05080b}
.reference-portraits img{aspect-ratio:3/4}
.reference-squares img{aspect-ratio:1}
.reference-gallery figcaption{font-size:12px}
.logic-figure{margin-top:28px;margin-bottom:28px}
.logic-figure img{width:100%;height:auto;background:#000}
@media(max-width:600px){
  .reference-gallery{grid-template-columns:1fr;gap:28px}
  .reference-portraits img{aspect-ratio:auto;max-height:70vh}
  .reference-gallery figcaption{font-size:12px}
}
