/* Reference: wkshps.com. White page, tight 6px gutters, images edge to edge, one type size. */
:root {
  --bg: #fff;
  --fg: #000;
  --gut: 6px;
  --text: clamp(19px, 2.08vw, 30px);
  --small: 13px;
  --sans: "Hanken Grotesk", Helvetica, Arial, "Noto Sans SC", "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--text)/1.2 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; font: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- nav: inverts against whatever sits under it ---------- */
/* Logo and links are fixed separately: the links invert against the page (difference blend),
   the logo stays white, and a fixed parent would trap the blend in its own stacking context. */
.nav { pointer-events: none; }
.nav a, .nav button { pointer-events: auto; }
.nav-mid { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 20; }
.nav-logo { display: block; }
/* white, with a soft shadow so it still reads over pale photos and white sections */
.nav-logo img { display: block; width: auto; height: 1.6em; filter: brightness(0) invert(1) drop-shadow(0 0 3px rgba(0, 0, 0, 0.55)); }
/* About has no photos behind it: inverts instead, black on the page and white where it crosses text */
.nav-mid--invert { mix-blend-mode: difference; }
.nav-mid--invert .nav-logo img { filter: brightness(0) invert(1); }
.nav-right { position: fixed; top: 8px; right: 12px; z-index: 20; display: flex; gap: 0.8em; align-items: baseline; color: #fff; mix-blend-mode: difference; }
.nav a:hover, .nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.sound { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; pointer-events: auto; text-decoration: line-through; text-decoration-thickness: 1px; opacity: .6; }
.sound.is-on { text-decoration: none; opacity: 1; }
.lang { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.lang:hover { text-decoration: underline; text-decoration-thickness: 1px; }

/* ---------- pixel arrow cursor everywhere, links and sliders included ---------- */
html, body, *, *::before, *::after { cursor: url("../images/cursor.svg") 0 0, url("../images/cursor.png") 0 0, auto !important; }

/* ---------- home splash: the handwritten logo fills the screen, then fades into the work ---------- */
.splash { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: #fff; opacity: 1; transition: opacity .8s ease; }
.splash.is-leaving { opacity: 0; pointer-events: none; }
.splash canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.splash video { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
/* no WebGL: show the clip itself, still filling the width */
.splash.no-gl canvas { display: none; }
/* 129.3vw makes the 698px-wide logo in the 960px clip span 94% of the screen, as in the WebGL version */
.splash.no-gl video { left: 50%; top: 50%; width: 129.3vw; height: 129.3vw; transform: translate(-50%, -50%); opacity: 1; filter: contrast(3); }
html.splash-on { overflow: hidden; }

/* ---------- work grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gut); padding: var(--gut); }
.tile { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #eee; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-b { opacity: 0; }
.tile:hover .tile-b, .tile:focus-visible .tile-b { opacity: 1; }
.tile h3 { position: absolute; inset: auto 8px 6px 8px; color: #fff; mix-blend-mode: difference; opacity: 0; }
.tile:focus-visible h3 { opacity: 1; }
/* home: name and kind of work, shown on hover; the logo stays put */
.tile-info { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: grid; gap: 2px; padding: 7px 10px 8px; background: #fff; color: #000; opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.tile-info h3 { position: static; color: inherit; mix-blend-mode: normal; opacity: 1; font-weight: 600; line-height: 1.2; }
.tile-type { font-size: var(--small); line-height: 1.3; opacity: .7; }
.tile:hover .tile-info, .tile:focus-visible .tile-info { opacity: 1; transform: none; }
.hover-title {
  position: fixed; inset: 0 0 auto 0; z-index: 15; padding: 0 12px;
  font-size: clamp(48px, 9vw, 150px); line-height: 1; letter-spacing: -0.02em; text-align: center;
  color: #fff; mix-blend-mode: difference; pointer-events: none;
}
body.has-hover .nav-mid { visibility: hidden; }
@media (hover: none) { .tile h3 { opacity: 1; } .tile-info { opacity: 1; transform: none; } .hover-title { display: none; } }

/* ---------- project ---------- */
.hero img { width: 100%; }
.project { display: grid; gap: var(--gut); }
.intro {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gut);
  padding: clamp(48px, 7vw, 110px) 12px clamp(56px, 8vw, 120px);
}
.intro-r { display: grid; gap: 1em; max-width: 40em; }
.small { font-size: var(--small); line-height: 1.3; margin-top: 0.6em; }
.stats { display: flex; gap: 2em; }
.stats dd { font-size: var(--small); }
.row { display: flex; gap: var(--gut); align-items: flex-start; width: var(--w); padding-inline: var(--gut); }
.row.right { margin-left: auto; }
.row figure { flex: var(--a) 1 0; min-width: 0; }
.row figure video { display: block; width: 100%; height: auto; background: #000; }
.row[style*="--w:100%"] { padding-inline: 0; }
.row[style*="--w:100%"][data-n="1"] { padding-inline: 0; }
/* click-through social post: arrows, click either half, or swipe */
.post { position: relative; }
.post-track { display: flex; aspect-ratio: 1410 / 2000; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: pointer; background: #000; }
.post-track::-webkit-scrollbar { display: none; }
.post-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; scroll-snap-stop: always; -webkit-user-drag: none; }
.post-btn { position: absolute; top: 50%; width: 36px; height: 36px; margin-top: -18px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #000; font: inherit; font-size: 16px; line-height: 36px; cursor: pointer; }
.post-prev { left: 10px; }
.post-next { right: 10px; }
.post-btn[disabled] { display: none; }
.post-count { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: var(--small); line-height: 1.4; pointer-events: none; }
.post-dots { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.post-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); }
.post-dots i.on { background: #fff; }

/* horizontal auto-scrolling gallery: js/main.js duplicates the figures so it loops */
.slider { overflow-x: auto; scrollbar-width: none; cursor: grab; }
.slider::-webkit-scrollbar { display: none; }
.slider.is-dragging { cursor: grabbing; }
.slider-track { display: flex; width: max-content; height: clamp(260px, 38vw, 620px); }
.slider figure { height: 100%; margin-right: var(--gut); flex: none; }
.slider img { width: auto; height: 100%; max-width: none; -webkit-user-drag: none; user-select: none; }
.slider--three .slider-track { height: calc((100vw - 2 * var(--gut)) / 3 / 0.664); } /* portrait images, about three fit across */
.slider--four .slider-track { height: calc((100vw - 3 * var(--gut)) / 4 / 1.414); } /* frames are 1.414:1, four fit across */
.sec { padding: clamp(40px, 6vw, 90px) 12px 10px; }
.impact { padding-top: clamp(40px, 6vw, 90px); }
.impact-nums { display: flex; flex-wrap: wrap; gap: 0.5em clamp(32px, 7vw, 120px); padding-inline: 12px; }
.impact-nums b { display: block; font-weight: 400; font-size: clamp(60px, 11vw, 190px); line-height: 1; letter-spacing: -0.03em; }
.impact-nums span { display: block; margin-top: 0.3em; }
.note { max-width: 32em; padding: clamp(24px, 3vw, 44px) 12px; }
.big { padding: clamp(60px, 9vw, 150px) 12px; font-size: clamp(48px, 9vw, 150px); line-height: 1; letter-spacing: -0.02em; text-align: center; }
.related { padding-bottom: var(--gut); }
.related-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gut); padding-inline: var(--gut); }
.related .tile h3 { inset: auto 8px 6px 8px; font-size: var(--small); line-height: 1.2; }
.related .tile:hover h3 { opacity: 1; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 64px); align-items: start; padding: clamp(80px, 9vw, 130px) clamp(12px, 3vw, 40px) clamp(60px, 8vw, 120px); font-size: 16px; line-height: 1.5; }
.about-photo { position: sticky; top: 76px; }
.about-photo img { width: 100%; height: auto; display: block; }
.about-text { display: grid; gap: 1em; max-width: 40em; }
.about .lead { font-size: clamp(26px, 3.2vw, 46px); line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 0.4em; }
.about .facts { font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6em var(--gut); margin-top: 1.2em; }
.facts h2 { font-weight: 600; }
.facts a { font-weight: 600; }
.todo { color: #777; }

/* ---------- footer ---------- */
.foot { padding: clamp(40px, 6vw, 90px) 3px 10px; }
.foot-mark { display: block; position: relative; overflow: hidden; aspect-ratio: 698 / 228; }
.foot-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* The clip is a 960px square: this crops it to the logo (x 132-830, y 366-594).
   contrast() takes its off-white ground to pure white and firms up the upscaled edges. */
.foot-mark video { display: none; position: absolute; left: -18.91%; top: -160.53%; width: 137.54%; max-width: none; height: auto; filter: contrast(3); }
.foot-mark.is-live video { display: block; }
.foot-mark.is-live img { display: none; }
.foot-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3em 1.6em; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--fg); font-size: var(--small); line-height: 1.2; }

/* ---------- section notes: inline on phones, shown one at a time in the left column on wider screens ---------- */
.sec-desc { max-width: 36em; padding: 4px 12px 14px; font-size: 15px; line-height: 1.5; }
.sec-desc-label { display: none; }
:lang(zh-CN) .sec-desc, :lang(zh-CN) .side-section p { line-height: 1.7; }
.side-sections { display: none; }

/* ---------- project pages: fixed introduction on the left, the work scrolls on the right ---------- */
@media (min-width: 641px) {
  .project.split { grid-template-columns: clamp(220px, 27vw, 420px) minmax(0, 1fr); column-gap: 0; row-gap: var(--gut); }
  .project-side { grid-column: 1; }
  .project-side .intro {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none;
    display: flex; flex-direction: column; gap: 1.6em; padding: 76px clamp(14px, 1.6vw, 22px) 28px 14px;
  }
  .project-side .intro::-webkit-scrollbar { display: none; }
  .project-side .intro-r { font-size: 15px; line-height: 1.45; }
  .project-flow { grid-column: 2; display: grid; gap: var(--gut); min-width: 0; container-type: inline-size; }
  .split .related { grid-column: 1 / -1; }
  /* notes stay in the flow as invisible markers; the left column shows the one in view */
  .project-flow > h2.sec { height: clamp(56px, 7cqw, 120px); padding: 0; overflow: hidden; color: transparent; user-select: none; }
  .project-flow .sec-desc.sec-desc--break { height: clamp(32px, 4cqw, 64px); }
  .project-flow .sec-desc { height: 0; padding: 0; overflow: hidden; visibility: hidden; }
  .side-sections { display: grid; }
  .side-sections > *, .project-side .intro-r { grid-area: 1 / 1; transition: opacity .35s ease, visibility .35s; }
  .side-section { opacity: 0; visibility: hidden; display: grid; gap: .8em; align-content: start; font-size: 15px; line-height: 1.45; }
  .side-section .sec-desc-label { display: block; font-size: 17px; font-weight: 600; line-height: 1.25; }
  .side-section.is-on { opacity: 1; visibility: visible; }
  .project-side .intro.has-section .intro-r { opacity: 0; visibility: hidden; }
  .project-side .intro { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
  .project-side .intro > .intro-r, .project-side .intro > .side-sections { grid-row: 2; grid-column: 1; }
  .project-side .intro-r, .side-sections { align-content: start; align-self: start; }
  /* sizes that used to follow the window now follow the work column, so every row keeps its fill */
  .project-flow .slider--three .slider-track { height: calc((100cqw - 2 * var(--gut)) / 3 / 0.664); }
  .project-flow .slider--four .slider-track { height: calc((100cqw - 3 * var(--gut)) / 4 / 1.414); }
  .project-flow .big { padding: clamp(50px, 9cqw, 150px) 12px; font-size: clamp(40px, 9cqw, 150px); }
  .project-flow .impact-nums b { font-size: clamp(52px, 11cqw, 190px); }
  .project-flow .sec, .project-flow .impact { padding-top: clamp(36px, 6cqw, 90px); }
}
@media (max-width: 640px) {
  /* one column again: picture, introduction, then the work */
  .project.split { display: flex; flex-direction: column; }
  .project-flow { display: contents; }
  .project-flow > * { order: 2; }
  .project-flow > .hero { order: 0; }
  .project-side { order: 1; }
  .split .related { order: 3; }
}

:lang(zh-CN) body, :lang(zh-CN) .foot-line { font-family: "Noto Sans SC", "PingFang SC", var(--sans); }
:lang(zh-CN) .intro-r p, :lang(zh-CN) .about p, :lang(zh-CN) .note { line-height: 1.55; font-size: 0.86em; }
:lang(zh-CN) .about .lead { font-size: clamp(24px, 2.9vw, 42px); line-height: 1.25; }

@media (max-width: 700px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro, .facts { grid-template-columns: minmax(0, 1fr); gap: 1.2em; }
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-photo { position: static; }
  .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slider--four .slider-track { height: calc((100vw - var(--gut)) / 2 / 1.414); }
  .slider--three .slider-track { height: 100vw; }
  .row { width: 100%; padding-inline: var(--gut); flex-wrap: wrap; }
  .row.right { margin-left: 0; }
  .row figure { flex: 1 1 calc(50% - var(--gut)); }
  .row[data-n="1"] figure { flex-basis: 100%; }
  .nav { font-size: 17px; }
  .nav-mid { left: 8px; transform: none; }
  .nav-right { right: 8px; }
}
