/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #6b6b6b;
  --ink-3: #9a9a9a;
  --rule: #e6e6e6;
  --tile: #f2f2f2;

  --sans: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --m: clamp(14px, 1.6vw, 24px);   /* page margin */
  --gap: clamp(6px, 0.75vw, 12px); /* gutter between photos */
  --head: 76px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: italic 400 18px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--m); top: 10px; z-index: 50; background: var(--bg); padding: 6px 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   Header / footer
   ========================================================================== */
.site-head {
  position: sticky; top: 0; z-index: 20;
  height: var(--head);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--m);
  background: var(--bg);
  transition: transform .4s var(--ease);
}
.site-head.is-hidden { transform: translateY(-100%); }
.mark {
  font: italic 400 24px/1 var(--sans); 
}
.nav { display: flex; gap: clamp(22px, 3vw, 44px); }
.nav a {
  font: italic 400 18px/1 var(--sans); 
  color: var(--ink); transition: color .2s;
}
.nav a:hover { color: var(--ink-3); }
.nav a[aria-current] { color: var(--ink-3); }
.menu-btn { display: none; font: italic 400 18px/1 var(--sans);  }

.site-foot {
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: clamp(56px, 8vw, 110px);
  padding: 26px var(--m) calc(26px + env(safe-area-inset-bottom));
  font-size: 15px; color: var(--ink-2);
}
.foot-links { display: flex; gap: 22px; }
.foot-links a:hover { color: var(--ink); }

/* ==========================================================================
   Image surface
   ========================================================================== */
.ph { display: block; position: relative; overflow: hidden; background: var(--tone, var(--tile)); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.js .ph img { opacity: 0; transition: opacity .6s var(--ease); }
.js .ph img.is-in { opacity: 1; }

/* ==========================================================================
   The wall: uncropped photos packed into columns
   ========================================================================== */
.wall { padding: 0 var(--m); }
.wall.is-packed { display: flex; gap: var(--gap); align-items: flex-start; }
.wall .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.tile { width: 100%; aspect-ratio: var(--ar); cursor: zoom-in; }
.tile img { transition: opacity .6s var(--ease), filter .3s; }
@media (hover: hover) { .tile:hover img { filter: brightness(.92); } }

/* without the script: plain CSS columns, same look */
.wall:not(.is-packed) { columns: 4; column-gap: var(--gap); }
.wall[data-cols="3"]:not(.is-packed) { columns: 3; }
.wall:not(.is-packed) .tile { break-inside: avoid; margin-bottom: var(--gap); }

/* ==========================================================================
   Page titles
   ========================================================================== */
.page-title {
  margin: 0;
  font: italic 400 clamp(30px, 3.2vw, 44px)/1.1 var(--sans); 
}
.p-work .page-title { padding: clamp(28px, 4vw, 56px) var(--m) clamp(24px, 3vw, 40px); text-align: center; }

.col-head { text-align: center; padding: clamp(32px, 5vw, 72px) var(--m) clamp(28px, 4vw, 52px); }
.col-meta { margin: 12px 0 0; font-size: 17px;  color: var(--ink-2); }
.col-intro { margin: 18px auto 0; max-width: 46ch; font-size: 19px; color: var(--ink-2); }

/* ==========================================================================
   Collections index
   ========================================================================== */
.covers {
  list-style: none; margin: 0; padding: 0 var(--m);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 3vw, 44px) var(--gap);
}
.cover { display: block; }
.cover-img { aspect-ratio: 4 / 5; }
.cover-img img { transition: opacity .6s var(--ease), transform 1s var(--ease); }
@media (hover: hover) { .cover:hover .cover-img img { transform: scale(1.02); } }
.cover-t { display: block; margin-top: 14px; font-size: 21px;  }
.cover-m { display: block; margin-top: 4px; font-size: 15px; color: var(--ink-3); }

.pager {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: clamp(40px, 6vw, 80px) var(--m) 0;
  font-size: 18px; 
}
.pager a:last-child { justify-self: end; }
.pager a:hover { color: var(--ink-3); }

/* ==========================================================================
   About / Contact
   ========================================================================== */
.about {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding: clamp(28px, 4vw, 56px) var(--m) 0;
  max-width: 1200px; margin: 0 auto;
}
.about-img { aspect-ratio: 4 / 5; }
.about:not(:has(.about-img)) { grid-template-columns: minmax(0, 560px); justify-content: center; }
.about-text .page-title { margin-bottom: 26px; }
.about-text p { margin: 0 0 1em; max-width: 40ch; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.4; color: #222; }
.about-links { font-size: 18px;  }
.about-links a, .contact a { border-bottom: 1px solid var(--rule); transition: border-color .2s; }
.about-links a:hover, .contact a:hover { border-color: var(--ink); }

.contact { max-width: 560px; margin: 0 auto; padding: clamp(40px, 6vw, 90px) var(--m) 0; text-align: center; }
.contact .page-title { margin-bottom: 28px; }
.contact p { color: #333; }
.contact-list { margin: 28px 0 0; display: grid; gap: 6px; }
.contact-list dt { margin-top: 14px; font-size: 15px;  color: var(--ink-3); }
.contact-list dd { margin: 0; font-size: 16px; }

/* contact page, after the Malibu layout: tall photo left, form panel right */
.contact-page {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 80px);
  padding: 8px var(--m) 0; align-items: start;
}
.contact-img { aspect-ratio: 2 / 3; }
.contact-page:not(:has(.contact-img)) { grid-template-columns: minmax(0, 560px); justify-content: center; }
.contact-body { padding-top: clamp(16px, 5vw, 72px); max-width: 560px; justify-self: center; width: 100%; text-align: center; }
.contact-lede { margin: 18px auto 0; max-width: 34ch; font-size: 20px; color: var(--ink-2); }
.form { margin-top: 34px; padding: clamp(22px, 3vw, 40px); background: #faf7f2; text-align: left; display: grid; gap: 18px; }
.form label { display: grid; gap: 6px; font-size: 16px; color: var(--ink-2); }
.form input, .form textarea {
  font: italic 400 18px/1.4 var(--sans); color: var(--ink);
  padding: 10px 12px; border: 1px solid #e3ded5; background: #fff; border-radius: 0; width: 100%;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink); }
.form textarea { resize: vertical; min-height: 140px; }
.form .hp { position: absolute; left: -9999px; }
.send {
  justify-self: center; margin-top: 6px; padding: 12px 34px;
  font: italic 400 19px/1 var(--sans); color: var(--bg); background: var(--ink);
  transition: opacity .2s;
}
.send:hover { opacity: .85; }
.send[disabled] { opacity: .5; cursor: default; }
.form-status { margin: 0; min-height: 1.4em; text-align: center; font-size: 17px; color: var(--ink-2); }
.contact-alt { margin-top: 24px; color: var(--ink-2); }
.contact-alt a { border-bottom: 1px solid var(--rule); }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink);
  display: none; grid-template: auto 1fr auto / 64px 1fr 64px;
}
.lb[open] { display: grid; animation: lb-in .25s var(--ease); }
.lb::backdrop { background: var(--bg); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-close { grid-area: 1 / 3; justify-self: end; padding: 24px var(--m); font-size: 18px;  }
.lb-stage { grid-area: 2 / 2; min-height: 0; display: grid; place-items: center; touch-action: pan-y; }
.lb-stage picture { display: contents; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: opacity .25s var(--ease); }
.lb-stage img.is-loading { opacity: 0; }
.lb-prev, .lb-next { grid-row: 2; font-size: 20px; color: var(--ink-2); }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }
.lb-prev:hover, .lb-next:hover, .lb-close:hover { color: var(--ink-3); }
.lb-bar {
  grid-area: 3 / 1 / 4 / 4; display: flex; justify-content: space-between; gap: 20px;
  padding: 18px var(--m) calc(18px + env(safe-area-inset-bottom));
  font-size: 16px;  color: var(--ink-2);
}
.lb-cap a { border-bottom: 1px solid var(--rule); }
.lb-cap a:hover { color: var(--ink); }
.lb-count { font-variant-numeric: tabular-nums; }
body.lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .js .ph img, .site-head, .lb[open] { transition: none; animation: none; }
}

/* ==========================================================================
   Tablet / phone
   ========================================================================== */
@media (max-width: 1100px) {
  .wall:not(.is-packed) { columns: 3; }
}
@media (max-width: 760px) {
  :root { --head: 60px; }
  .mark { font-size: 21px; }
  .menu-btn { display: block; }
  .nav {
    position: fixed; inset: var(--head) 0 auto 0; z-index: 19;
    flex-direction: column; gap: 0; padding: 8px var(--m) 20px;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { padding: 12px 0; font-size: 22px; }
  .wall:not(.is-packed), .wall[data-cols="3"]:not(.is-packed) { columns: 2; }
  .covers { grid-template-columns: repeat(2, 1fr); }
  .about, .contact-page { grid-template-columns: 1fr; }
  .contact-img { aspect-ratio: 4 / 5; }
  .pager { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .pager > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .lb { grid-template-columns: 0 1fr 0; }
  .lb-prev, .lb-next { display: none; }
  .site-foot { flex-direction: column; gap: 10px; }
}
