/* Paper-cut theme after "Car Chase" / "Sketchbook": white paper, ballpoint-blue ink, lavender shadows. Jost throughout. */
:root {
  --bg: #f3f2ee;
  --paper: #ffffff;
  --fg: #111111;
  --ink: #111111;
  --muted: #6b6b6b;
  --shade: #d9d9d9;
  --line: #dcdcdc;
  --gap: 14px;
  --pad: 20px;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* paper grain */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .92 0 0 0 0 .92 0 0 0 0 .95 0 0 0 .18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* paper sheet: used by cards, players, portrait, lightbox */
.sheet { background: var(--paper); padding: 6px; box-shadow: 0 1px 0 var(--ink), 0 18px 40px -14px rgba(0,0,0,.22), 0 0 0 1.5px var(--ink); }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 16px var(--pad); border-bottom: 1.5px solid var(--ink); background: rgba(243,242,238,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.top nav a { font-weight: 500; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; margin-right: 24px; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.top .views { display: flex; gap: 2px; border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px; }
.top .views a { font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; color: var(--muted); }
.top .views a.on { background: var(--ink); color: var(--bg); }
.top .views a:hover:not(.on) { color: var(--ink); }

/* ===== home: the paper tunnel ===== */
.index { padding: 0; }
.field-wrap { position: relative; }           /* height set by JS = depth + viewport */
.field { position: sticky; top: 0; height: 100vh; height: 100dvh; margin-top: calc(-1 * var(--top-h, 59px)); overflow: hidden;
  background: radial-gradient(110% 80% at 50% 50%, #ffffff 0%, var(--bg) 60%, #e6e7ef 100%); }
.scene { position: absolute; inset: 0; perspective: 1000px; perspective-origin: 50% 50%; }
.space { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; pointer-events: none; }   /* the plane itself must not catch clicks meant for cards behind it */
.field-hint { position: absolute; left: var(--pad); bottom: 44px; color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; transition: opacity .5s; }
.field-hint.hide { opacity: 0; }

/* title: nearest object in the tunnel */
.title3d { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate3d(-50%, -50%, 0); transform-origin: 50% 50%; text-align: center; pointer-events: none; white-space: nowrap; will-change: transform, opacity; }
.title3d .big { display: block; font-weight: 700; font-size: clamp(96px, 23vw, 420px); letter-spacing: -0.035em; line-height: .95; color: var(--ink); }
.title3d .small { display: flex; justify-content: center; gap: 14px; margin-top: 4px; }
.title3d .small i { position: relative; font: 700 clamp(22px, 2.6vw, 40px)/1 var(--hand); color: var(--fg); background: var(--paper); padding: 8px 18px 10px; box-shadow: 0 10px 24px -12px rgba(0,0,0,.4); transform: rotate(var(--r, 0deg)); }
.title3d .small i::before { content: ""; position: absolute; inset: -1px; border: 1.5px solid var(--fg); border-radius: 200px 12px 180px 12px / 12px 180px 12px 200px; }
.title3d .small i:nth-child(1) { --r: -2.5deg; margin-top: 6px; }
.title3d .small i:nth-child(2) { --r: 1.5deg; }
.title3d .small i:nth-child(3) { --r: -1deg; margin-top: 10px; }
.title3d.gone { opacity: 0 !important; }

/* cards: paper sheets on the tunnel surface */
.fcard { position: absolute; left: 50%; top: 50%; width: var(--w, 220px); margin-left: calc(var(--w, 220px) / -2); transform-style: preserve-3d;
  transform: translate3d(var(--x, 0px), var(--y, 0px), var(--z, 0px)) translateY(-50%) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .7s cubic-bezier(.2,.7,.2,1), opacity .4s, filter .4s; will-change: transform, opacity, filter; backface-visibility: hidden; cursor: pointer; pointer-events: auto; }
.fcard.tall { --w: clamp(190px, 21vw, 300px); }
.fcard.wide { --w: clamp(280px, 33vw, 470px); }
.fcard .thumb { position: relative; background: var(--paper); padding: 12px 12px 14px; box-shadow: 0 24px 40px -16px rgba(0,0,0,.35); }
.fcard .thumb::before, .polaroid::before { content: ""; position: absolute; inset: -1px; pointer-events: none; border: 1.6px solid var(--fg); border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px; }
.fcard .thumb::after, .polaroid::after { content: ""; position: absolute; inset: 1px -2px -2px 1px; pointer-events: none; border: 1px solid var(--fg); opacity: .35; border-radius: 18px 225px 18px 255px / 255px 18px 225px 18px; }
.fcard .thumb .frame, .polaroid .frame { position: relative; overflow: hidden; background: var(--shade); border-radius: 160px 10px 140px 10px / 10px 140px 10px 160px; box-shadow: 0 0 0 1.4px var(--fg); }
.fcard.tall .thumb .frame { aspect-ratio: 3 / 4; }
.fcard.wide .thumb .frame { aspect-ratio: 3 / 2; }
.fcard .thumb img, .fcard .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fcard .thumb img { filter: grayscale(1) contrast(1.05) brightness(1.05); transition: filter .6s; }
.fcard .thumb video { opacity: 0; transition: opacity .35s; }
.fcard.focus .thumb img { filter: none; }
.fcard.focus .thumb video { opacity: 1; }
.fcard .caption { display: grid; gap: 0; padding: 10px 4px 0; min-height: 56px; font-family: var(--hand); }
.fcard .caption .t { font-weight: 700; font-size: 22px; line-height: 1.05; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard .caption .m { color: var(--muted); font-weight: 500; font-size: 16px; }
.fcard.focus { transform: translate3d(calc(var(--x, 0px) + var(--fx, 0px)), calc(var(--y, 0px) + var(--fy, 0px)), calc(var(--z, 0px) + var(--push, 200px))) translateY(-50%) rotateX(0deg) rotateY(0deg) scale(1.08); z-index: 2; filter: none !important; opacity: 1 !important; }
.fcard.gone { opacity: 0 !important; filter: none !important; pointer-events: none; }

/* grid view */
.grid { display: none; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 36px 28px; padding: 36px var(--pad) 60px; max-width: 1400px; margin: 0 auto; align-items: start; }
body.view-grid .grid { display: grid; }
body.view-grid .field-wrap { display: none; }
body.view-grid .grid.about-board { display: block; max-width: 1240px; padding-top: 28px; }
.fcard.note-card { --w: clamp(260px, 30vw, 440px); }
.fcard.note-card .thumb { padding: 22px 26px 24px; }
.fcard.note-card p { margin: 0; font-family: var(--hand); font-weight: 600; font-size: clamp(22px, 2vw, 30px); line-height: 1.25; color: var(--fg); }
.fcard.still { cursor: default; }
.grid .fcard { will-change: transform, opacity; }
.warp { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.warp .fcard { position: absolute; margin: 0; transform-origin: 50% 50%; transition: none; }

.grid .fcard { position: static; width: auto; margin: 0; transform: rotate(var(--gr, 0deg)); transition: transform .4s; }
.grid .fcard:nth-child(3n) { --gr: 1.4deg; } .grid .fcard:nth-child(3n+1) { --gr: -1.1deg; } .grid .fcard:nth-child(5n+2) { --gr: 2deg; }
.grid .fcard:hover, .grid .fcard.focus { transform: rotate(0deg) scale(1.03); z-index: 1; }
.grid .fcard .caption .t { white-space: normal; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(243,242,238,.94); display: grid; place-items: center; padding: var(--pad); }
.lightbox[hidden] { display: none; }
.lb-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 36px; align-items: start; width: min(1200px, 100%); max-height: 100%; }
.lightbox.portrait .lb-inner { grid-template-columns: minmax(0, 440px) minmax(260px, 420px); justify-content: center; }
.lb-media { background: var(--paper); padding: 6px; box-shadow: 0 0 0 1.5px var(--ink), 0 30px 60px -20px rgba(0,0,0,.28); }
.lb-media video { width: 100%; max-height: calc(100vh - 2 * var(--pad) - 12px); background: #000; }
.lb-info { padding-top: 6px; }
.lb-title { font-weight: 600; font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -0.015em; line-height: 1.05; margin: 0 0 16px; color: var(--ink); }
.lb-desc { font-weight: 300; font-size: 18px; line-height: 1.45; margin: 0 0 22px; }
.lb-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, max-content)); gap: 8px 28px; margin: 0 0 24px; }
.lb-meta div { display: grid; }
.lb-links a { display: inline-block; font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1.5px solid var(--shade); padding-bottom: 2px; margin-right: 22px; color: var(--ink); }
.lb-links a:hover { border-color: var(--ink); }
.lb-close { position: fixed; top: 10px; right: 14px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); font: 300 36px/1 var(--font); cursor: pointer; opacity: .75; }
.lb-close:hover, .lb-close:focus-visible { opacity: 1; outline: none; }
body.lb-open { overscroll-behavior: none; }

/* ===== work page ===== */
.work { display: grid; gap: 32px; max-width: 1200px; margin: 0 auto; }
.work.landscape { grid-template-columns: 1fr; }
.work.portrait { grid-template-columns: minmax(0, 420px) 1fr; }
.player { background: var(--paper); padding: 6px; box-shadow: 0 0 0 1.5px var(--ink), 0 30px 60px -20px rgba(0,0,0,.28); }
.player video { width: 100%; aspect-ratio: var(--ratio); background: #000; }
.work h1 { font-weight: 600; font-size: clamp(30px, 3.4vw, 48px); letter-spacing: -0.015em; line-height: 1.05; margin: 0 0 20px; color: var(--ink); }
.desc { font-weight: 300; font-size: clamp(19px, 1.7vw, 24px); line-height: 1.4; max-width: 30em; margin: 0; }
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, max-content)); gap: 8px 32px; margin: 24px 0; }
dl div { display: grid; }
dt { font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
dd { margin: 0; }
.ig { display: inline-block; font-weight: 500; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; border: 1.5px solid var(--ink); color: var(--ink); padding: 9px 18px; border-radius: 999px; }
.ig:hover { background: var(--ink); color: #fff; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 16px; border-top: 1.5px solid var(--shade); color: var(--muted); font-weight: 500; font-size: 14px; }
.pager a:hover { color: var(--ink); }
main.work, main.about { padding: var(--pad); padding-bottom: 60px; }

/* ===== about: a board of polaroids and notes ===== */
.about { max-width: none; margin: 0; padding-top: 0; }
.board { display: grid; grid-template-columns: repeat(12, 1fr); gap: 36px 28px; align-items: start; }
.board > * { margin: 0; }
.note { grid-column: span 5; font-weight: 300; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.3; padding: 18px 22px; background: var(--paper); box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 20px 36px -18px rgba(0,0,0,.3); transform: rotate(var(--r, 0deg)); }
.note.head { grid-column: span 7; }
.note.head h1 { font-weight: 600; font-size: clamp(34px, 4.2vw, 60px); letter-spacing: -0.015em; line-height: 1.02; margin: 0; }
.note .alias { display: block; color: var(--muted); font-style: italic; font-weight: 300; font-size: .5em; letter-spacing: .02em; margin-top: 8px; }
.note.links { grid-column: span 4; font-size: 14px; }
.note.links a { font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin-right: 24px; border-bottom: 1.5px solid var(--shade); padding-bottom: 2px; }
.note.links a:hover { border-color: var(--fg); }
.polaroid { grid-column: span 4; background: var(--paper); padding: 10px 10px 12px; box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 24px 40px -16px rgba(0,0,0,.35); transform: rotate(var(--r, 0deg)); }
.polaroid .frame { aspect-ratio: 4 / 5; }
.polaroid img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .5s; }
.polaroid:hover img { filter: none; }
.polaroid figcaption { display: grid; gap: 0; padding: 10px 4px 0; min-height: 56px; font-family: var(--hand); }
.polaroid .t { font-weight: 700; font-size: 22px; line-height: 1.05; }
.polaroid .m { color: var(--muted); font-weight: 500; font-size: 16px; }
/* scatter: notes and polaroids share rows */
.board { gap: 28px 24px; }
.note { grid-column: span 4; }
.polaroid { grid-column: span 3; }
.board > :nth-child(1)  { --r: -1.2deg; grid-column: 1 / span 7; }
.board > :nth-child(2)  { --r: 2deg;    grid-column: 9 / span 3; margin-top: -6px; }
.board > :nth-child(3)  { --r: .8deg;   grid-column: 2 / span 4; margin-top: -60px; }
.board > :nth-child(4)  { --r: -2.4deg; grid-column: 6 / span 3; margin-top: -150px; }
.board > :nth-child(5)  { --r: 1.4deg;  grid-column: 9 / span 4; margin-top: -30px; }
.board > :nth-child(6)  { --r: 1.8deg;  grid-column: 1 / span 3; margin-top: -40px; }
.board > :nth-child(7)  { --r: -.9deg;  grid-column: 4 / span 4; margin-top: 60px; }
.board > :nth-child(8)  { --r: -1.6deg; grid-column: 9 / span 3; margin-top: -120px; }
.board > :nth-child(9)  { --r: 1.1deg;  grid-column: 1 / span 4; margin-top: -20px; }
.board > :nth-child(10) { --r: 2.2deg;  grid-column: 5 / span 3; margin-top: -90px; }
.board > :nth-child(11) { --r: -1.3deg; grid-column: 8 / span 4; margin-top: 40px; }
.board > :nth-child(12) { --r: -2deg;   grid-column: 2 / span 3; margin-top: -60px; }
.board > :nth-child(13) { --r: .6deg;   grid-column: 6 / span 4; align-self: end; }

footer { display: flex; justify-content: space-between; padding: var(--pad); border-top: 1.5px solid var(--ink); color: var(--muted); font-size: 12px; letter-spacing: .02em; margin-top: 40px; }
footer a { font-weight: 500; color: var(--ink); }

@media (max-width: 720px) {
  :root { --pad: 16px; --gap: 10px; }
  .top nav a { margin-right: 12px; font-size: 13px; }
  .top .views a { padding: 4px 9px; font-size: 11px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
  .title3d { white-space: normal; }
  .title3d .small { flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; }
  .title3d .small i { font-size: 22px; padding: 6px 14px 8px; margin-top: 0 !important; }
  .work.portrait { grid-template-columns: 1fr; }
  .work.portrait .player { max-width: 420px; margin: 0 auto; }
  .about { padding-top: 8px; }
  .board { grid-template-columns: 1fr; gap: 26px; }
  .board > * { grid-column: auto !important; margin-top: 0 !important; }
  .polaroid { max-width: 320px; }
  .lb-inner, .lightbox.portrait .lb-inner { grid-template-columns: 1fr; gap: 18px; overflow: auto; }
  .lightbox.portrait .lb-media { max-width: 70vw; margin: 0 auto; }
  .lb-media video { max-height: 60vh; }
}
