/* Shared styles — homepage and project pages */
:root {
  --bg: #000;
  --fg: #dcdbd9;
  --muted: #7d7c7a;
  --iris: linear-gradient(#ecebe8, #ecebe8);
  --pad: clamp(18px, 4vw, 52px);
  /* Type printed on film: a touch out of focus, with light bleeding around it (halation) */
  --halo: blur(.5px) drop-shadow(0 0 .05em rgba(236,235,232,.55)) drop-shadow(0 0 .32em rgba(236,235,232,.22));
  --halo-soft: blur(.3px) drop-shadow(0 0 2px rgba(236,235,232,.4)) drop-shadow(0 0 9px rgba(236,235,232,.14));
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: "Instrument Sans", system-ui, sans-serif; font-size: 16px; text-transform: lowercase; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
::selection { background: #ecebe8; color: #000; }

/* Celluloid grain over everything, black and white throughout */
body::after, [data-film]::after {
  content: ""; position: fixed; inset: -60%; z-index: 100; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.4s steps(6) infinite;   /* softer, slower grain — easier on the eyes */
}
/* On the cinema page the grain lives on the screen only */
body.theater::after { content: none; }
[data-film]::after { position: absolute; z-index: 5; }
@keyframes grain {
  0%, 100% { transform: translate(0, 0); } 17% { transform: translate(-4%, 3%); } 33% { transform: translate(3%, -5%); }
  50% { transform: translate(-6%, -2%); } 67% { transform: translate(5%, 4%); } 83% { transform: translate(-2%, 6%); }
}

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: 30px var(--pad);
  background: linear-gradient(#000 55%, rgba(0,0,0,0));
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 17px; }
.site-header nav a, .icons a { opacity: .85; transition: opacity .25s; }
.site-header nav a:hover, .icons a:hover { opacity: 1; }
.name { font-size: 25px; letter-spacing: .01em; }
.icons { display: flex; justify-content: flex-end; gap: 18px; }
.icons svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* Media blocks */
.media { position: relative; display: block; width: min(100%, 1040px); aspect-ratio: 16 / 9; overflow: hidden; background: #0c0c0c; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.12); transition: transform 1.6s cubic-bezier(.2,.7,.1,1); }
a.media:hover img, a.media:hover video { transform: scale(1.03); }

/* Pills */
.pill {
  display: inline-block; margin-top: 26px; padding: 13px 28px;
  border: 2px solid rgba(220, 219, 217, .7); border-radius: 999px;
  font-size: 15px; letter-spacing: .02em; transition: color .3s, border-color .3s, background-position .6s;
  background: var(--iris); background-size: 0% 100%; background-repeat: no-repeat;
}
.pill:hover { color: #000; border-color: transparent; background-size: 100% 100%; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }

/* Talk */
.talk { display: flex; flex-direction: column; align-items: center; padding: 0 var(--pad) clamp(110px, 18vh, 200px); text-align: center; }
.talk h2 { margin: 0; font-size: clamp(44px, 8vw, 120px); font-weight: 400; line-height: .95; letter-spacing: -.03em; }
.talk p { max-width: 42ch; margin: 26px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

/* Footer credits */
footer { padding: 0 var(--pad) 48px; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 22px; }
footer nav a:hover { color: var(--fg); }

/* Fade in */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.2s ease, transform 1.2s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

/* Project pages */
.project { display: flex; flex-direction: column; align-items: center; padding: 140px var(--pad) clamp(90px, 14vh, 160px); text-align: center; }
.project .kicker { color: var(--muted); font-size: 15px; }
.project h1 { max-width: 16ch; margin: 14px 0 clamp(40px, 7vh, 72px); font-size: clamp(44px, 7.5vw, 112px); font-weight: 400; line-height: .98; letter-spacing: -.03em; }
.project .media { margin-bottom: clamp(44px, 7vh, 72px); }
.project .text { max-width: 58ch; }
.project .text p { margin: 0 0 1.2em; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.6; }
.project .text p:first-child { font-size: clamp(21px, 2vw, 28px); line-height: 1.4; }
.credits { margin: clamp(36px, 6vh, 60px) 0 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.credits dt { display: inline; }
.credits dt::after { content: " — "; }
.credits dd { display: inline; margin: 0; color: var(--fg); }
.credits dd::after { content: "\A"; white-space: pre; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(100%, 1040px); margin-top: clamp(60px, 9vh, 100px); }
.gallery .media { width: 100%; aspect-ratio: 4 / 3; }
.next { display: block; padding: 0 var(--pad) clamp(100px, 16vh, 180px); text-align: center; }
.next span { display: block; margin-bottom: 12px; color: var(--muted); font-size: 15px; }
.next strong { font-size: clamp(34px, 5.5vw, 80px); font-weight: 400; letter-spacing: -.03em; background: var(--iris); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; background-size: 0% 100%; background-repeat: no-repeat; transition: background-size .8s ease; }
.next strong { -webkit-text-fill-color: var(--fg); }
.next:hover strong { -webkit-text-fill-color: transparent; background-size: 100% 100%; }

@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; padding-top: 22px; }
  .site-header nav { display: none; }
  .name { font-size: 21px; }
  .gallery { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  body::after, [data-film]::after { animation: none; }
}

/* ── Documentary grammar (see site.js) ───────────────────────────────── */
/* Handwritten note + arrow drawn onto a photo */
.note { position: absolute; inset: 0; z-index: 1; pointer-events: none; transform-origin: 50% 50%;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.9)) drop-shadow(0 0 14px rgba(0,0,0,.55)); }
.note svg { position: absolute; inset: 0; overflow: visible; fill: none; stroke: #f4f2ec; stroke-linecap: round; stroke-linejoin: round; }
.note .one { position: absolute; inset: 0; }
.note .shaft { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); }
.note .head { opacity: 0; }
.note .shaft { animation: drawLen .75s cubic-bezier(.5,0,.3,1) calc(var(--d) + 1s) forwards; }
@keyframes drawLen { to { stroke-dashoffset: 0; } }
.note .head { animation: pop .15s ease-out calc(var(--d) + 1.72s) forwards; }
.note .label { position: absolute; width: max-content; font-family: "Caveat", cursive; font-weight: 600; line-height: 1.1; color: #f4f2ec; text-transform: none;
  transform: rotate(-4deg); clip-path: inset(-20% 100% -20% 0); animation: write 1s steps(18) var(--d) forwards; }
.note.instant .shaft, .note.instant .head, .note.instant .label { animation-duration: 0s; animation-delay: 0s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
@keyframes write { to { clip-path: inset(-20% -5% -20% 0); } }

/* Subtitles, like a documentary */
.sub { position: absolute; left: 6%; right: 6%; bottom: 7%; z-index: 3; margin: 0; text-align: center; pointer-events: none; }
.sub span { display: inline-block; max-width: 46ch; padding: .15em .4em; color: #f4f2ec; font-family: "Instrument Sans", sans-serif; font-size: clamp(14px, 1.55cqw, 22px); line-height: 1.4;
  text-shadow: 0 1px 2px #000, 0 0 12px rgba(0,0,0,.8); opacity: 0; animation: subIn .5s ease forwards; }
@keyframes subIn { from { opacity: 0; } to { opacity: 1; } }

/* Typewriter */
.typed i { font-style: normal; opacity: 0; animation: key .01s linear forwards; }
@keyframes key { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .note .shaft, .note .head, .note .label, .sub span, .typed i { animation-duration: 0s !important; animation-delay: 0s !important; }
}

/* Film burn between scenes (site.js filmBurn) */
.burn { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 4; pointer-events: none; mix-blend-mode: screen; opacity: 0; }
.burn.on { opacity: 1; }
