:root { --bg: #f5f3eb; --ink: #1a1a18; --dim: #76746c; --ph: #3b3b39; --ease: cubic-bezier(.22,.8,.18,1); --pad: 18px; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #141413; --ink: #ecebe4; --dim: #8d8b83; --ph: #262624; color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #141413; --ink: #ecebe4; --dim: #8d8b83; --ph: #262624; color-scheme: dark; }
@media (min-width: 900px) { :root { --pad: 28px; } }
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: var(--bg); color: var(--ink); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; line-height: 1.5; transition: background-color .3s, color .3s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.stage { position: fixed; inset: 0; height: 100dvh; overflow: hidden; background: var(--bg); transition: background-color .3s; touch-action: none; user-select: none; -webkit-user-select: none; }

/* top bar: back, signature, light/dark */
.bar { position: absolute; inset: 0 0 auto 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: calc(var(--pad) - 2px + env(safe-area-inset-top, 0px)) var(--pad) 0; pointer-events: none; }
.bar > * { pointer-events: auto; }
.back { font-size: 15px; line-height: 1; width: max-content; }
.title { display: block; text-align: center; }
.sigmark { display: block; width: 104px; margin: 0 auto; }
.sigmark .signature { display: block; width: 100%; height: auto; overflow: visible; color: var(--ink); }
.signature :is(path, rect, polygon, circle) { fill: currentColor; stroke: none; }
.signature mask polyline { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) { .sigmark { width: 128px; } }
.mode-ico { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mode-ico.i-sun { display: none; }
:root[data-theme="dark"] .mode-ico.i-sun { display: block; }
:root[data-theme="dark"] .mode-ico.i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mode-ico.i-sun { display: block; } :root:not([data-theme="light"]) .mode-ico.i-moon { display: none; } }
.mode { justify-self: end; padding: 4px 0; margin: -4px 0; }

/* the reel: images run in an endless loop, driven by scroll / swipe */
.reel { position: absolute; inset: 0; z-index: 1; }
.fr { position: absolute; left: calc(100% - var(--pad) - var(--fw) / 2); top: 0; margin: 0; width: var(--fw); visibility: hidden; will-change: transform; }
.fr img, .fr video { display: block; width: 100%; height: auto; pointer-events: none; background: var(--ph); }
.fr.ph { background: var(--ph); display: grid; place-items: end start; }
.fr.ph span { padding: 10px 12px; color: #a9a79e; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.reel { --fw: 62vw; }
@media (min-width: 900px) { .reel { --fw: min(42vw, 640px); } .fr { left: calc(100% - 6vw - var(--fw) / 2); } }

/* project text sits on the left, over the images */
.info { position: absolute; z-index: 20; left: var(--pad); top: 50%; transform: translateY(-50%); width: calc(62vw - var(--pad)); pointer-events: none; color: #fff; mix-blend-mode: difference; }
.info h1 { margin: 0; font-size: clamp(18px, 5.2vw, 26px); line-height: 1.15; font-weight: 500; letter-spacing: -.01em; }
.info .year { margin: 0 0 10px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.info .sub { margin: 4px 0 0; font-size: 13px; opacity: .8; }
.info .desc { margin-top: 18px; font-size: 12px; line-height: 1.55; }
.info .desc p { margin: 0 0 .9em; }
@media (min-width: 900px) { .info { left: calc(var(--pad) + 3vw); width: 36vw; } .info h1 { font-size: clamp(24px, 2.4vw, 36px); } .info .desc { font-size: 13px; } }

.foot { position: absolute; inset: auto 0 0 0; z-index: 30; display: flex; justify-content: space-between; padding: 46px var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px)); text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; color: var(--dim); pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg) 62%); }
.foot a { pointer-events: auto; padding: 8px 0; margin: -8px 0; transition: color .2s; }
.foot a:hover { color: var(--ink); }

/* ---------- Long text: first paragraph + "Read more" that opens the full text over a blurred page ---------- */
.info .desc.long p:nth-child(n+2) { display: none; }
.info .readmore { pointer-events: auto; margin-top: 4px; padding: 8px 0; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid currentColor; cursor: pointer; color: inherit; }
.reel, .info { transition: filter .9s var(--ease), opacity .5s var(--ease); }
.reading .reel { filter: blur(15px); }
.reading .info { opacity: 0; pointer-events: none; }
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
         background: color-mix(in srgb, var(--bg) 62%, transparent); color: var(--ink);
         opacity: 0; transition: opacity .7s var(--ease); padding: calc(70px + env(safe-area-inset-top, 0px)) var(--pad) 90px; }
.sheet.open { opacity: 1; }
.sheet[hidden] { display: none; }
.sheet-in { width: min(100%, 560px); margin: auto; clip-path: inset(46% 0 46% 0); transition: clip-path 1s var(--ease); }
.sheet.open .sheet-in { clip-path: inset(0); }
.sheet-in > * { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.sheet.open .sheet-in > * { opacity: 1; transform: none; transition-delay: calc(.12s + var(--n, 0) * .1s); }
.sheet-h { margin: 0 0 22px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; }
.sheet p { font-size: 14px; line-height: 1.65; margin: 0 0 1.2em; }
.sheet-x { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px 0 calc(22px + env(safe-area-inset-bottom, 0px)); text-align: center; text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; color: var(--dim); background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg) 85%, transparent) 60%); }
.sheet-x:hover { color: var(--ink); }
.reading .foot { opacity: 0; pointer-events: none; }
.foot { transition: opacity .5s var(--ease); }
@media (min-width: 900px) { .sheet p { font-size: 16px; } .sheet-in { width: min(100%, 620px); } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-in, .sheet-in > * { transition: none !important; } .sheet-in { clip-path: none; } }

/* Read-more sheet: same layout as the Art page text (header, line, Description row) */
.sheet-in { padding: 40px 0 90px; }
.sheet-sub { margin: 6px 0 26px !important; font-size: 14px !important; line-height: 1.35 !important; opacity: .75; }
.sheet-row { display: grid; grid-template-columns: 24% 1fr; gap: 12px; align-items: start; }
.sheet-row h3 { margin: 0; font-size: 10px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.sheet .sheet-desc p { font-size: 12.5px; line-height: 1.55; margin: 0 0 .9em; font-weight: 300; }
.sheet .sheet-desc p:last-child { margin-bottom: 0; }
@media (min-width: 900px) { .sheet-in { width: min(100%, 860px); } .sheet-row { grid-template-columns: 22% 1fr; } .sheet .sheet-desc p { font-size: 14px; } }

/* tap a reel picture: it grows to fill the screen */
.fr:not(.ph):not(.fv) { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 90; touch-action: none; cursor: zoom-out; user-select: none; -webkit-user-select: none; --o: 1; }
.zoom::before { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: 0; transition: opacity .45s var(--ease); }
.zoom.in::before { opacity: calc(.98 * var(--o)); }
.zoom .zcap { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); margin: 0; padding: 0 20px; text-align: center; font-size: 11px; letter-spacing: .08em; color: var(--text); opacity: 0; transition: opacity .4s var(--ease) .2s; pointer-events: none; }
.zoom.in .zcap { opacity: calc(.75 * var(--o)); }
.zoom img { position: absolute; display: block; max-width: none; transform-origin: 0 0; will-change: transform; transition: transform .65s var(--ease); pointer-events: none; -webkit-user-drag: none; }
@media (prefers-reduced-motion: reduce) { .zoom::before, .zoom img { transition-duration: .01s; } }
/* while a picture is zoomed, the text, header and footer are hidden; when the picture is back in place they fade in over it (instead of popping) */
.info, .foot, .bar { transition: opacity .6s var(--ease); }
.zooming .info, .zooming .foot, .zooming .bar { opacity: 0; pointer-events: none; }

/* Strip layout: one row of pictures along the bottom of the screen, moving sideways */
.reel.strip { --sh: 50dvh; inset: auto 0 calc(58px + env(safe-area-inset-bottom, 0px)) 0; height: var(--sh); }
.strip .fr { left: 0; top: 0; width: auto; height: var(--sh); }
.strip .fr img, .strip .fr video { width: auto; height: 100%; }
.strip .fr.ph { width: calc(var(--sh) * .8); }
.reel.strip + .info { top: calc(25dvh + 24px); width: calc(100% - 2 * var(--pad)); max-width: 560px; }
@media (min-width: 900px) { .reel.strip + .info { left: calc(var(--pad) + 3vw); width: 36vw; } }

/* Video in the middle of a strip-layout page: the video fills the middle, the picture strip runs along the bottom, and the text sits where it does on the other projects (left, centred, over the picture) */
:root { --sh2: 24dvh; }
.midvid { position: absolute; z-index: 2; left: var(--pad); right: var(--pad); top: calc(70px + env(safe-area-inset-top, 0px)); bottom: calc(58px + var(--sh2) + 16px); pointer-events: none; }
.midvid video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.reel.strip.has-vid { --sh: var(--sh2); }
.reel.strip.has-vid ~ .info { top: calc((100dvh - 58px - var(--sh2)) / 2 + 20px); width: calc(62vw - var(--pad)); max-width: none; }
.reel.strip.has-vid ~ .info .desc.long p:first-child { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin-bottom: .4em; }
@media (min-width: 900px) {
  :root { --sh2: 28dvh; }
  .reel.strip.has-vid ~ .info { left: calc(var(--pad) + 3vw); width: 36vw; }
  .reel.strip.has-vid ~ .info .desc.long p:first-child { -webkit-line-clamp: 6; }
}
