/* Photo site: dark charcoal, photos in columns, one typeface (Inter)
   everywhere, one soft blue for links. Inspired by madebyfinn.com and
   alexstrohl.com. See DESIGN.md. */

/* Inter is served from this site, not from Google, so visitors' IP
   addresses are not sent to a third party. Latin subset, weights 400–500. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #17191c;
  --text: #e9e7e3;
  --muted: #a3a5a8;
  --line: #2c2f33;
  --link: #8fb8e6;
  --tile: #202327;
  --lightbox: #0f1012;
  --lb-ui: #9a9ca0;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(18px, 5vw, 72px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.7 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; }

/* Header: name left, small spaced-out menu right */
/* Stays at the top of the screen while scrolling. */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 14px 24px;
  padding: max(clamp(20px, 2.6vw, 32px), env(safe-area-inset-top)) var(--gutter) clamp(20px, 2.6vw, 32px);
}
main { flex: 1; padding-top: clamp(8px, 1.6vw, 24px); }
#contact { scroll-margin-top: 120px; }
.logo {
  font: 500 clamp(.92rem, 1.3vw, 1.05rem)/1 var(--sans);
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
}
.site-header nav {
  display: flex; gap: clamp(22px, 3vw, 40px);
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
}
.site-header nav a {
  color: var(--muted); text-decoration: none;
  padding-bottom: 4px; border-bottom: 1px solid transparent;
  transition: color .2s;
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); border-color: var(--link); }

/* Footer: one quiet line */
.site-footer {
  padding: clamp(48px, 6vw, 80px) var(--gutter) max(32px, env(safe-area-inset-bottom));
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.footer-link { white-space: nowrap; } /* keeps "· Privacy" together */
.site-footer a { color: inherit; text-underline-offset: 3px; padding: 8px 0; }
.site-footer a:hover, .site-footer a[aria-current="page"] { color: var(--text); }

/* Photos: original shapes, in columns of different heights (like
   alexstrohl.com). arrange.js builds the columns; CSS columns are the
   no-JavaScript fallback. */
.gallery {
  --gap: clamp(10px, 1.8vw, 28px);
  columns: 3; column-gap: var(--gap);
  padding: 0 var(--gutter);
}
.gallery.is-masonry { columns: auto; display: flex; gap: var(--gap); align-items: flex-start; }
.gallery-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.photo { margin: 0 0 var(--gap); break-inside: avoid; }
.gallery.is-masonry .photo { margin: 0; }
.photo a { display: block; overflow: hidden; background: var(--tile); }
.photo img { width: 100%; height: auto; transition: opacity .3s; }
.photo a:hover img { opacity: .88; }
/* No "Save image" menu on an iPhone long-press (owner's choice; see lightbox.js). */
.photo img, .lb-stage img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* About: small spaced-capital headings, grey text, contact underneath */
.about { padding: clamp(8px, 3vw, 40px) var(--gutter) 0; }
.about-inner { max-width: 720px; margin-left: clamp(0px, 12vw, 180px); }
/* Headings stay smaller than the name in the header: small spaced capitals. */
.about h1, .about h2 {
  font: 500 .78rem/1.2 var(--sans);
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--text); margin: 0 0 22px;
}
.about p { color: var(--muted); font-size: 1.05rem; margin: 0 0 18px; }
.contact-block { margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line); }
.about .contact-line { color: var(--text); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: var(--lightbox); color: var(--lb-ui);
  display: grid; grid-template-rows: auto 1fr;
  padding: max(14px, env(safe-area-inset-top)) clamp(12px, 3vw, 28px) max(16px, env(safe-area-inset-bottom));
  gap: 12px; overflow: hidden; /* swiped neighbours stop at the screen edge */
  touch-action: none; /* no pinch or double-tap zoom in the viewer (owner's choice) */
}
.lightbox[hidden] { display: none; }
.lightbox:focus { outline: none; }
.lb-bar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.lb-stage {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: clamp(4px, 2vw, 16px); min-height: 0;
}
/* The photo always fills the space, so the small copy shown first and the
   sharp one that replaces it appear at the same size. */
.lb-stage img {
  width: 100%; height: calc(100vh - 100px); height: calc(100dvh - 100px);
  max-width: none; object-fit: contain;
  transition: opacity .25s;
}
/* The neighbours shown beside the photo during a swipe; lightbox.js sets
   their place and size. */
.lb-stage { position: relative; }
.lb-stage .lb-peek { position: absolute; pointer-events: none; transition: none; }
.lb-stage .lb-btn { position: relative; z-index: 1; }
.lb-btn {
  background: none; border: 0; color: var(--lb-ui); cursor: pointer;
  font: 300 2rem/1 var(--sans); padding: 10px; min-width: 44px; min-height: 44px;
}
.lb-btn:hover { color: var(--text); }
.lb-close { font: 400 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; padding: 8px 0 8px 8px; }
.lb-nav { display: flex; align-items: center; }
.lb-nav .lb-btn { display: none; font-size: 1.5rem; padding: 0; } /* phones only */
body.lb-open { overflow: hidden; }

@media (max-width: 900px) {
  .gallery { columns: 2; }
}
@media (max-width: 560px) {
  .about-inner { margin-left: 0; }
  .footer-link { display: block; margin-top: 6px; } /* Privacy on its own line */
  .footer-sep { display: none; }
  .lb-stage { grid-template-columns: minmax(0, 1fr); }
  .lb-stage .lb-btn { display: none; } /* swipe, or the small ‹ › by the counter */
  .lb-nav .lb-btn { display: inline-block; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
