/* Self-hosted (SIL OFL) so the hero never waits on a third-party font request. */
@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bricolage-grotesque-latin.woff2) format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Pixelify Sans"; src: url(fonts/pixelify-sans-latin.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --ground: #2b2420; --ground2: #3a302a; --ground3: #4a3d34; --deep: #221c19;
  --text: #f6e9d8; --muted: #c9b8a6; --accent: #e9bfa2; --lilac: #7d7593; --sage: #79a37a; --slate: #26324d;
  --gut: clamp(16px, 5vw, 64px);
  --display: "Bricolage Grotesque", "PingFang HK", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --pixel: "Pixelify Sans", "PingFang HK", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scrollbar-color: var(--lilac) var(--deep); -webkit-text-size-adjust: 100%; }
body { background: var(--ground); color: var(--text); font: 400 18px/1.6 var(--display); text-rendering: optimizeLegibility; }
:lang(zh-HK) body, body:lang(zh-HK) { line-height: 1.75; letter-spacing: .02em; }
::selection { background: var(--accent); color: var(--ground); }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 2px; text-decoration-color: var(--lilac); }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
p, li, dd { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 20; background: var(--accent); color: var(--ground); padding: 8px 14px; font: 500 16px var(--pixel); }
.skip:focus { top: 8px; }

/* Header over the sky */
.top { position: absolute; inset: 0 0 auto; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding: 20px var(--gut); font: 500 19px var(--pixel); }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.brand svg { width: 22px; height: 30px; flex: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 2px; text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 calc(100% - 6px) / 0 2px no-repeat; transition: background-size .2s steps(5); }
.top nav a:hover, .top nav a[aria-current="page"] { background-size: 100% 2px; }

/* Scenes */
.scene { position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.scene--full { min-height: 100svh; min-height: 100vh; }
@supports (min-height: 100svh) { .scene--full { min-height: 100svh; } }
.scene--page { min-height: max(460px, 66svh); }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; background: var(--slate); }
.scene-copy { position: relative; z-index: 2; width: fit-content; max-width: 100%; padding: 0 var(--gut) clamp(40px, 8vh, 88px); }
h1 { font-weight: 800; font-size: clamp(44px, 6.4vw, 96px); line-height: .95; letter-spacing: -.035em; max-width: 11ch; text-wrap: balance; }
:lang(zh-HK) h1 { letter-spacing: 0; line-height: 1.15; max-width: 7em; }
.nb { display: inline-block; }
.scene--page h1 { max-width: 14ch; }
.lede { max-width: 36ch; margin-top: 20px; color: var(--muted); font-size: clamp(18px, 1.6vw, 21px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 28px; }

.btn { display: inline-block; background: var(--accent); color: var(--ground); padding: 14px 26px; font: 500 18px/1.2 var(--pixel); text-decoration: none; box-shadow: 6px 6px 0 var(--lilac); transition: transform .12s steps(2), box-shadow .12s steps(2); }
.btn:hover { background: #f6dcbf; transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--lilac); }
.btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--lilac); }
.link { display: inline-block; padding-block: 10px; font: 500 18px var(--pixel); text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 calc(100% - 8px) / 0 2px no-repeat, linear-gradient(var(--lilac), var(--lilac)) 0 calc(100% - 8px) / 100% 2px no-repeat;
  transition: background-size .24s steps(6); }
.link:hover, .link:focus-visible { background-size: 100% 2px, 100% 2px; }

/* Sections: full-width ground bands joined by checker-dither seams */
.sec { padding: clamp(72px, 10vw, 128px) 0 0; }
.scene + .sec { padding-top: clamp(48px, 7vw, 104px); }
.sec > h2, .sec > .intro { padding-inline: var(--gut); }
h2 { font-weight: 800; font-size: clamp(32px, 4.2vw, 58px); line-height: 1.02; letter-spacing: -.03em; max-width: 18ch; text-wrap: balance; }
:lang(zh-HK) h2 { letter-spacing: 0; line-height: 1.25; }
.intro { max-width: calc(64ch + 2 * var(--gut)); margin-top: 22px; color: var(--muted); font-size: clamp(18px, 1.5vw, 20px); }
.sec > h2 + .bands, .sec > .intro + .bands { margin-top: clamp(36px, 5vw, 56px); }
.band { position: relative; background: var(--b); padding: clamp(32px, 4vw, 48px) var(--gut); --a: var(--ground); --b: var(--ground2); }
.band::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; background: repeating-conic-gradient(var(--a) 0 25%, var(--b) 0 50%) 0 0 / 8px 8px; }
.band h3 { transition: transform .16s steps(2); }
.band:hover h3 { transform: translateX(6px); }
.band:nth-child(2n) { --a: var(--ground2); --b: var(--ground3); }
.band:nth-child(2n+3) { --a: var(--ground3); --b: var(--ground2); }
.band:last-child::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: repeating-conic-gradient(var(--b) 0 25%, var(--ground) 0 50%) 0 0 / 8px 8px; z-index: 1; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 12px 40px; align-items: baseline; }
.row h3 { font-weight: 800; font-size: clamp(30px, 3.6vw, 50px); line-height: 1.02; letter-spacing: -.03em; }
:lang(zh-HK) .row h3 { letter-spacing: 0; line-height: 1.2; }
.row p, .row ul { color: var(--muted); max-width: 52ch; }
.row ul { padding-left: 1.1em; }
.row li + li { margin-top: 6px; }
.row li::marker { color: var(--sage); }
.more { padding: 22px var(--gut) 0; }

/* Work */
.work { display: grid; gap: clamp(56px, 8vw, 104px); padding: clamp(40px, 5vw, 64px) var(--gut) 0; }
.sec > .work:first-child { padding-top: 0; }
.project { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px clamp(28px, 4vw, 56px); align-items: center; }
.project:nth-child(2n) .shot { order: 2; }
.shot { position: relative; overflow: hidden; display: block; background: var(--deep); border: 4px solid var(--ground3); box-shadow: 8px 8px 0 var(--lilac); transition: transform .12s steps(2), box-shadow .12s steps(2); }
.shot:hover { transform: translate(4px, 4px); box-shadow: 4px 4px 0 var(--lilac); }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.shot:hover img, .shot:focus-visible img { transform: scale(1.04); }
/* A band of low sun sweeps across the screenshot in pixel steps. */
.shot::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 35%, rgb(246 220 191 / .22) 50%, transparent 65%); transform: translateX(-110%); }
.shot:hover::after, .shot:focus-visible::after { transform: translateX(110%); transition: transform .7s steps(9); }
.project :is(h2, h3) { font-weight: 800; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.02; letter-spacing: -.03em; }
.project .kind { font: 500 17px var(--pixel); color: var(--sage); margin-top: 10px; }
.project p { color: var(--muted); margin-top: 14px; max-width: 46ch; }
.project .link { margin-top: 8px; }

/* Steps: a real sequence, so it is numbered */
.steps { list-style: none; padding: 0; margin-top: clamp(36px, 5vw, 56px); counter-reset: step; }
.steps li { counter-increment: step; }
.steps h3 { display: flex; align-items: baseline; gap: .45em; }
.steps h3::before { content: counter(step); flex: none; min-width: .9em; font: 500 .9em/1 var(--pixel); letter-spacing: 0; color: var(--accent); }
.js-steps h3::before { color: var(--lilac); transition: color .3s steps(3); }
.js-steps .lit h3::before { color: var(--accent); animation: blip .36s steps(3); }
@keyframes blip { 40% { transform: translateY(-.18em); } }

/* Terms */
.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px 48px; padding: clamp(36px, 5vw, 56px) var(--gut) 0; }
.terms dt { font: 500 19px var(--pixel); color: var(--accent); }
:lang(zh-HK) :is(.terms dt, .project .kind, .btn, .link, .top nav, .foot) { font-weight: 700; font-synthesis: none; }
.terms dd { color: var(--muted); margin-top: 6px; max-width: 44ch; }

/* Contact */
.mailbig { display: inline-block; font-weight: 800; font-size: clamp(26px, 4.6vw, 60px); letter-spacing: -.03em; line-height: 1.1; overflow-wrap: anywhere; }
.checklist { list-style: none; padding: 0; display: grid; gap: 14px; margin-top: 8px; }
.checklist li { display: grid; grid-template-columns: 18px 1fr; gap: 14px; color: var(--muted); }
.checklist li::before { content: ""; width: 10px; height: 10px; margin-top: .55em; background: var(--sage); box-shadow: 4px 4px 0 var(--ground3); }

main > .sec:last-child { padding-bottom: clamp(88px, 12vw, 160px); }

/* Close + footer */
.close { padding: clamp(88px, 12vw, 160px) var(--gut) clamp(56px, 8vw, 96px); }
.close h2 { max-width: 16ch; }
.close .actions { margin-top: 32px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 32px; padding: 28px var(--gut) 40px; border-top: 2px solid var(--ground3); font: 500 16px var(--pixel); color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 22px; margin-block: -12px; }
.foot a { display: inline-block; padding-block: 12px; text-decoration: none; }
.foot a { background: linear-gradient(var(--accent), var(--accent)) 0 calc(100% - 10px) / 0 2px no-repeat; transition: background-size .2s steps(5), color .2s; }
.foot a:hover { color: var(--text); background-size: 100% 2px; }

@media (max-width: 760px) {
  .top { font-size: 17px; padding-top: 16px; }
  .row { grid-template-columns: 1fr; gap: 10px; }
  .project { grid-template-columns: 1fr; }
  .project:nth-child(2n) .shot { order: 0; }
}
/* Focal moment: the headline and copy rise from behind the dune in pixel steps, in time with the sun. */
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { clip-path: inset(0 0 100% 0); transform: translateY(.6em); } to { clip-path: inset(-10% -5% -25% -5%); transform: none; } }
.scene-copy > * { animation: rise-in .56s steps(8, end) both; animation-delay: .1s; }
.scene-copy > :nth-child(2) { animation-delay: .22s; }
.scene-copy > :nth-child(3) { animation-delay: .34s; }
.scene--full .scene-copy > * { animation-delay: 1.1s; animation-duration: .7s; }
.scene--full .scene-copy > :nth-child(2) { animation-delay: 1.26s; }
.scene--full .scene-copy > :nth-child(3) { animation-delay: 1.42s; }

/* Page to page: the header stays put while the rest crossfades. */
@view-transition { navigation: auto; }
.top { view-transition-name: top; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .26s; }

@media (prefers-reduced-motion: reduce) {
  .scene-copy > * { animation: fade-in .3s ease-out both; }
  .band:hover h3, .shot:hover img, .js-steps .lit h3::before { transform: none; animation: none; }
  .shot::after { display: none; }
  @view-transition { navigation: none; }
  .btn, .shot { transition: none; }
}
