@font-face { font-family: Alpino; src: url(/fonts/Alpino-Variable.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Comico; src: url(/fonts/Comico-Regular.woff2) format("woff2"); font-display: swap; }

:root {
  --paper: #FAF9F6;
  --ink: #141311;
  --dim: #85827B;
  --gutter: clamp(16px, 3.3vw, 48px);
  --photo-w: min(66.67svh, 58vw);
  --ease: cubic-bezier(.16, 1, .3, 1);
}
@view-transition { navigation: auto; }
::view-transition-group(hero) { animation-duration: .7s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 450 17px/1.5 Alpino, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p, h1 { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: fixed; left: var(--gutter); top: -60px; z-index: 10; background: var(--ink); color: var(--paper); padding: 8px 14px; }
.skip:focus { top: 8px; }

/* Lazy images rise out of their dominant colour once they arrive. */
.js img[loading="lazy"]:not(.in) { opacity: 0; }
img[loading="lazy"] { transition: opacity .5s ease; }

/* Bar */
.bar { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; gap: 24px; padding: 24px var(--gutter); font-weight: 650; pointer-events: none; }
.bar a { pointer-events: auto; position: relative; display: inline-block; padding-block: 4px; }
.bar a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: 0; transition: transform .35s var(--ease); }
.bar a:hover::after, .bar a[aria-current="page"]::after { transform: scaleX(1); }
.bar nav { display: flex; gap: 18px; }

/* Handwritten note: one per screen */
.note { font: 400 clamp(22px, 2.1vw, 30px)/1.15 Comico, Alpino, sans-serif; text-transform: uppercase; transform: rotate(-3deg); transform-origin: 0 100%; animation: scrawl .8s var(--ease) both .25s; }
@keyframes scrawl { from { opacity: 0; transform: rotate(-7deg) translateY(10px); } }
.title { font-weight: 900; font-size: clamp(52px, 8.2vw, 136px); line-height: .94; letter-spacing: -.035em; text-wrap: balance; animation: rise .9s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }

/* Home */
.home main { min-height: 100svh; }
.stage { position: fixed; top: 0; right: 0; bottom: 0; width: var(--photo-w); overflow: hidden; background: var(--ink); }
.stage picture { position: absolute; inset: 0; }
.stage img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.tagline { margin-top: 14px; }
.index { min-height: 100svh; margin-right: var(--photo-w); padding: 84px var(--gutter) 24px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.list { font-weight: 850; font-size: min(6.1svh, 4.5vw); line-height: 1.03; letter-spacing: -.03em; }
.list li { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
.list a { display: flex; align-items: baseline; gap: .3em; transition: color .25s, transform .5s var(--ease); }
.list small { font-size: 17px; font-weight: 500; letter-spacing: 0; opacity: 0; transition: opacity .25s; }
.list:is(:hover, :focus-within) a { color: var(--dim); }
.list a.on, .list:is(:hover, :focus-within) a.on { color: var(--ink); transform: translateX(14px); }
.list a.on small { opacity: 1; }

/* Contact */
.contact-photo { position: fixed; top: 0; right: 0; bottom: 0; width: var(--photo-w); overflow: hidden; }
.contact-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.contact-text { min-height: 100svh; margin-right: var(--photo-w); padding: 96px var(--gutter) 28px; display: flex; flex-direction: column; justify-content: flex-end; }
.contact-text .note { margin-bottom: 8px; }
.contact-links { margin-top: 28px; font-weight: 800; font-size: clamp(22px, 3vw, 44px); line-height: 1.25; letter-spacing: -.02em; overflow-wrap: anywhere; }
.contact-links li + li { margin-top: 6px; }

/* Series */
.viewer { position: fixed; top: 0; right: 0; bottom: 0; width: var(--photo-w); outline: 0; }
.frames { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.frames::-webkit-scrollbar { display: none; }
.frames:focus-visible { outline-offset: -6px; outline-color: var(--paper); }
.frame { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: contain; }
.caption { min-height: 100svh; margin-right: var(--photo-w); padding: 96px var(--gutter) 28px; display: flex; flex-direction: column; justify-content: flex-end; }
.caption .note { margin-bottom: 8px; }
.label { margin-top: 18px; }
.controls { display: flex; align-items: baseline; gap: 22px; margin-top: 26px; font-weight: 650; }
.controls button { min-height: 44px; transition: transform .3s var(--ease); }
.controls button:hover { transform: translateX(var(--nudge, 3px)); }
.controls button:first-child { --nudge: -3px; }
.controls button:active { transform: scale(.96); }
.count { font-variant-numeric: tabular-nums; min-width: 4.5ch; text-align: center; }
.thumbs { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; padding-block: 5px; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs li { flex: 0 0 auto; width: 48px; }
.thumbs a { display: block; opacity: .55; transition: opacity .25s, transform .4s var(--ease); }
.thumbs a:hover, .thumbs a:focus-visible { opacity: 1; }
.thumbs a[aria-current] { opacity: 1; transform: translateY(-4px); }
.next { align-self: flex-start; margin-top: 20px; font-weight: 650; padding-block: 10px; transition: transform .4s var(--ease); }
.next:hover { transform: translateX(6px); }

/* Overview and archive */
.head { padding: 104px var(--gutter) 40px; }
.head .note { margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-inline: 6px; }
.grid a { display: block; }
.shot { position: relative; display: block; overflow: hidden; aspect-ratio: 2 / 3; }
.shot img { height: 100%; object-fit: cover; }
.grid img { transition: opacity .5s ease, transform 1s var(--ease); }
.grid a:hover img, .grid a:focus-visible img { transform: scale(1.03); }
.scrim { position: absolute; inset: 0; background: rgb(0 0 0 / .35); opacity: 0; transition: opacity .2s; }
.grid a:hover .scrim, .grid a:focus-visible .scrim { opacity: 1; }
.card { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px 22px; }
.card-title { font-weight: 850; font-size: clamp(22px, 2.2vw, 34px); line-height: 1.05; letter-spacing: -.02em; }
.card-meta { flex: none; font-size: 16px; }
.wall { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; padding-inline: 2px; }
.wall a { display: block; aspect-ratio: 2 / 3; overflow: hidden; }
.wall img { height: 100%; object-fit: cover; transition: opacity .5s ease, transform .6s var(--ease); }
.wall a:hover img, .wall a:focus-visible img { transform: scale(1.06); }
.wall a:focus-visible { outline-offset: -3px; outline-color: #fff; }
.close { padding: 120px var(--gutter) 24px; overflow: hidden; }
.close-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 20px; }
.close-links a, .tagline a, .contact-links a { text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 2px; }
.close-links a:hover, .tagline a:hover, .contact-links a:hover { text-decoration-thickness: 4px; }
.close-name { font-weight: 900; font-size: 13.2vw; line-height: .9; letter-spacing: -.04em; white-space: nowrap; }

/* Archive viewer */
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); overscroll-behavior: contain; }
.lightbox[open] { display: flex; flex-direction: row-reverse; animation: viewer-in .25s var(--ease); }
@keyframes viewer-in { from { opacity: 0; } }
.lightbox-photo { flex: none; height: 100%; aspect-ratio: 2 / 3; max-width: 58vw; background-size: cover; background-position: center; }
.lightbox-photo img { width: 100%; height: 100%; object-fit: contain; background: none !important; }
.lightbox-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 24px var(--gutter) 28px; }
.lightbox-info .note { margin-bottom: 10px; }
.lightbox-title { font-weight: 900; font-size: clamp(40px, 6vw, 96px); line-height: .96; letter-spacing: -.03em; text-wrap: balance; }
.lightbox-info .count { text-align: left; margin-top: 16px; font-weight: 650; }
.lightbox-info .controls { margin-top: 10px; }
.lightbox-close { position: absolute; top: 24px; left: var(--gutter); font-weight: 650; min-height: 44px; }
.lightbox-close:hover { text-decoration: underline; }
@media (max-width: 699px) {
  .lightbox[open] { flex-direction: column; }
  .lightbox-photo { width: 100%; height: auto; max-width: none; max-height: 66dvh; }
  .lightbox-info { padding-block: 12px 16px; }
  .lightbox-close { top: 8px; right: var(--gutter); left: auto; color: #fff; background: var(--ink); padding: 0 14px; }
}

/* Portraits drift into place as they scroll in, where the browser can tie that to the scroll itself. */
@supports (animation-timeline: view()) {
  .grid li, .close-name { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
  .frame img { animation: settle linear both; animation-timeline: view(inline); animation-range: entry 0% entry 100%; }
  @keyframes settle { from { transform: scale(1.08); } }
}

/* Side-by-side layout keeps the nav on the paper, so it stays readable over any photo. */
@media (min-width: 900px) and (orientation: landscape) {
  .home .bar, .series .bar, .contact .bar { right: var(--photo-w); }
}

/* Stacked layout: phones and upright tablets */
@media (max-width: 899px), (orientation: portrait) {
  .bar { position: static; padding: 2px var(--gutter); gap: 12px; }
  .bar a { padding-block: 12px; }
  .bar a::after { bottom: 8px; }
  .bar nav { gap: 12px; }
  .stage { position: sticky; top: 0; width: 100%; height: 56svh; z-index: 1; }
  .index { margin: 0; min-height: 0; padding: 26px var(--gutter) calc(38svh - 40px); justify-content: flex-start; }
  .list { font-size: clamp(30px, 8.6vw, 60px); line-height: 1.16; }
  .list a { min-height: 44px; }
  .list small { opacity: 1; }
  .note { font-size: 22px; text-wrap: balance; }
  .bar { flex-wrap: wrap; gap: 0 12px; }
  .contact-photo { position: static; width: 100%; height: 44svh; }
  .contact-text { min-height: 0; margin: 0; padding: 24px var(--gutter) 32px; }
  .contact-links { font-size: clamp(22px, 5.8vw, 44px); }

  .viewer { position: relative; width: 100%; height: auto; }
  .frames { height: auto; }
  .frame { height: min(150vw, 72svh); }
  .caption { min-height: 0; margin: 0; padding: 20px var(--gutter) 32px; }
  .title { font-size: clamp(50px, 14vw, 104px); }
  .thumbs { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .controls { justify-content: space-between; }
  .head { padding-top: 28px; padding-bottom: 24px; }
  .wall { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 699px) {
  .grid { grid-template-columns: 1fr; }
  .wall { grid-template-columns: repeat(4, 1fr); }
  .close { padding-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
