/*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */

.pswp {
  --pswp-bg: #000;
  --pswp-placeholder-bg: #222;
  

  --pswp-root-z-index: 100000;
  
  --pswp-preloader-color: rgba(79, 79, 79, 0.4);
  --pswp-preloader-color-secondary: rgba(255, 255, 255, 0.9);
  
  /* defined via js:
  --pswp-transition-duration: 333ms; */
  
  --pswp-icon-color: #fff;
  --pswp-icon-color-secondary: #4f4f4f;
  --pswp-icon-stroke-color: #4f4f4f;
  --pswp-icon-stroke-width: 2px;

  --pswp-error-text-color: var(--pswp-icon-color);
}


/*
	Styles for basic PhotoSwipe (pswp) functionality (sliding area, open/close transitions)
*/

.pswp {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: var(--pswp-root-z-index);
	display: none;
	touch-action: none;
	outline: 0;
	opacity: 0.003;
	contain: layout style size;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Prevents focus outline on the root element,
  (it may be focused initially) */
.pswp:focus {
  outline: 0;
}

.pswp * {
  box-sizing: border-box;
}

.pswp img {
  max-width: none;
}

.pswp--open {
	display: block;
}

.pswp,
.pswp__bg {
	transform: translateZ(0);
	will-change: opacity;
}

.pswp__bg {
  opacity: 0.005;
	background: var(--pswp-bg);
}

.pswp,
.pswp__scroll-wrap {
	overflow: hidden;
}

.pswp__scroll-wrap,
.pswp__bg,
.pswp__container,
.pswp__item,
.pswp__content,
.pswp__img,
.pswp__zoom-wrap {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.pswp__img,
.pswp__zoom-wrap {
	width: auto;
	height: auto;
}

.pswp--click-to-zoom.pswp--zoom-allowed .pswp__img {
	cursor: -webkit-zoom-in;
	cursor: -moz-zoom-in;
	cursor: zoom-in;
}

.pswp--click-to-zoom.pswp--zoomed-in .pswp__img {
	cursor: move;
	cursor: -webkit-grab;
	cursor: -moz-grab;
	cursor: grab;
}

.pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active {
  cursor: -webkit-grabbing;
  cursor: -moz-grabbing;
  cursor: grabbing;
}

/* :active to override grabbing cursor */
.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,
.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,
.pswp__img {
	cursor: -webkit-zoom-out;
	cursor: -moz-zoom-out;
	cursor: zoom-out;
}


/* Prevent selection and tap highlights */
.pswp__container,
.pswp__img,
.pswp__button,
.pswp__counter {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.pswp__item {
	/* z-index for fade transition */
	z-index: 1;
	overflow: hidden;
}

.pswp__hidden {
	display: none !important;
}

/* Allow to click through pswp__content element, but not its children */
.pswp__content {
  pointer-events: none;
}
.pswp__content > * {
  pointer-events: auto;
}


/*

  PhotoSwipe UI

*/

/*
	Error message appears when image is not loaded
	(JS option errorMsg controls markup)
*/
.pswp__error-msg-container {
  display: grid;
}
.pswp__error-msg {
	margin: auto;
	font-size: 1em;
	line-height: 1;
	color: var(--pswp-error-text-color);
}

/*
class pswp__hide-on-close is applied to elements that
should hide (for example fade out) when PhotoSwipe is closed
and show (for example fade in) when PhotoSwipe is opened
 */
.pswp .pswp__hide-on-close {
	opacity: 0.005;
	will-change: opacity;
	transition: opacity var(--pswp-transition-duration) cubic-bezier(0.4, 0, 0.22, 1);
	z-index: 10; /* always overlap slide content */
	pointer-events: none; /* hidden elements should not be clickable */
}

/* class pswp--ui-visible is added when opening or closing transition starts */
.pswp--ui-visible .pswp__hide-on-close {
	opacity: 1;
	pointer-events: auto;
}

/* <button> styles, including css reset */
.pswp__button {
	position: relative;
	display: block;
	width: 50px;
	height: 60px;
	padding: 0;
	margin: 0;
	overflow: hidden;
	cursor: pointer;
	background: none;
	border: 0;
	box-shadow: none;
	opacity: 0.85;
	-webkit-appearance: none;
	-webkit-touch-callout: none;
}

.pswp__button:hover,
.pswp__button:active,
.pswp__button:focus {
  transition: none;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  opacity: 1;
}

.pswp__button:disabled {
  opacity: 0.3;
  cursor: auto;
}

.pswp__icn {
  fill: var(--pswp-icon-color);
  color: var(--pswp-icon-color-secondary);
}

.pswp__icn {
  position: absolute;
  top: 14px;
  left: 9px;
  width: 32px;
  height: 32px;
  overflow: hidden;
  pointer-events: none;
}

.pswp__icn-shadow {
  stroke: var(--pswp-icon-stroke-color);
  stroke-width: var(--pswp-icon-stroke-width);
  fill: none;
}

.pswp__icn:focus {
	outline: 0;
}

/*
	div element that matches size of large image,
	large image loads on top of it,
	used when msrc is not provided
*/
div.pswp__img--placeholder,
.pswp__img--with-bg {
	background: var(--pswp-placeholder-bg);
}

.pswp__top-bar {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 60px;
	display: flex;
  flex-direction: row;
  justify-content: flex-end;
	z-index: 10;

	/* allow events to pass through top bar itself */
	pointer-events: none !important;
}
.pswp__top-bar > * {
  pointer-events: auto;
  /* this makes transition significantly more smooth,
     even though inner elements are not animated */
  will-change: opacity;
}


/*

  Close button

*/
.pswp__button--close {
  margin-right: 6px;
}


/*

  Arrow buttons

*/
.pswp__button--arrow {
  position: absolute;
  top: 0;
  width: 75px;
  height: 100px;
  top: 50%;
  margin-top: -50px;
}

.pswp__button--arrow:disabled {
  display: none;
  cursor: default;
}

.pswp__button--arrow .pswp__icn {
  top: 50%;
  margin-top: -30px;
  width: 60px;
  height: 60px;
  background: none;
  border-radius: 0;
}

.pswp--one-slide .pswp__button--arrow {
  display: none;
}

/* hide arrows on touch screens */
.pswp--touch .pswp__button--arrow {
  visibility: hidden;
}

/* show arrows only after mouse was used */
.pswp--has_mouse .pswp__button--arrow {
  visibility: visible;
}

.pswp__button--arrow--prev {
  right: auto;
  left: 0px;
}

.pswp__button--arrow--next {
  right: 0px;
}
.pswp__button--arrow--next .pswp__icn {
  left: auto;
  right: 14px;
  /* flip horizontally */
  transform: scale(-1, 1);
}

/*

  Zoom button

*/
.pswp__button--zoom {
  display: none;
}

.pswp--zoom-allowed .pswp__button--zoom {
  display: block;
}

/* "+" => "-" */
.pswp--zoomed-in .pswp__zoom-icn-bar-v {
  display: none;
}


/*

  Loading indicator

*/
.pswp__preloader {
  position: relative;
  overflow: hidden;
  width: 50px;
  height: 60px;
  margin-right: auto;
}

.pswp__preloader .pswp__icn {
  opacity: 0;
  transition: opacity 0.2s linear;
  animation: pswp-clockwise 600ms linear infinite;
}

.pswp__preloader--active .pswp__icn {
  opacity: 0.85;
}

@keyframes pswp-clockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/*

  "1 of 10" counter

*/
.pswp__counter {
  height: 30px;
  margin-top: 15px;
  margin-inline-start: 20px;
  font-size: 14px;
  line-height: 30px;
  color: var(--pswp-icon-color);
  text-shadow: 1px 1px 3px var(--pswp-icon-color-secondary);
  opacity: 0.85;
}

.pswp--one-slide .pswp__counter {
  display: none;
}

/* ---------- Theme ---------- */
:root {
  --bg: #fafaf8;
  --fg: #141414;
  --muted: #6f6f6b;
  --line: #e6e5e1;
  --tile: #ecebe7;
  --pad: clamp(16px, 4vw, 56px);
  --gap: clamp(6px, 0.7vw, 12px);
  --header-h: 64px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d0d0c;
  --fg: #ecebe8;
  --muted: #8e8d89;
  --line: #242422;
  --tile: #1a1a19;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
h1, h2 { font-weight: 500; }

.label {
  margin: 0 0 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
.wordmark {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: 32px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-link:hover,
.nav-link[aria-expanded="true"],
.nav-link[data-current] { color: var(--fg); }
.chev { transition: transform 0.2s; }
.dropdown-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: -14px;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s, transform 0.16s, visibility 0.16s;
}
.dropdown-toggle[aria-expanded="true"] + .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) {
  .dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
  .dropdown:hover .chev { transform: rotate(180deg); }
}
.dropdown-menu a {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.dropdown-menu a:hover, .dropdown-menu a[aria-current] { background: var(--tile); }
.dropdown-menu .n { color: var(--muted); font-variant-numeric: tabular-nums; }

.menu-toggle { display: none; }
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 19;
  padding: 16px var(--pad) 40px;
  overflow-y: auto;
  background: var(--bg);
}
.mobile-menu a {
  display: block;
  padding: 4px 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.mobile-menu a[aria-current] { color: var(--muted); }
.mobile-menu .label { margin: 28px 0 8px; }
.mobile-menu .mm-contact { margin-top: 28px; }
body.menu-open { overflow: hidden; }

@media (max-width: 719px) {
  :root { --header-h: 56px; }
  .nav { display: none; }
  .menu-toggle { display: inline-flex; color: var(--fg); }
}

/* ---------- Photo tiles ---------- */
.ph {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--c, var(--tile));
}
.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html.js .ph img:not(.loaded),
html.js .album-card img:not(.loaded) { opacity: 0; }

/* Justified rows: each photo's width is proportional to its aspect ratio,
   so every row lines up edge to edge without cropping. */
.jg { --row: 300px; display: flex; flex-wrap: wrap; gap: var(--gap); }
.jg::after { content: ""; flex-grow: 999999; }
.jg .ph {
  flex-grow: calc(var(--ar) * 100);
  flex-basis: calc(var(--ar) * var(--row));
  aspect-ratio: var(--ar);
  min-width: 0;
}
@media (max-width: 719px) { .jg { --row: var(--row-m, 150px); } }
@media (hover: hover) { .jg .ph:hover img { transform: scale(1.025); } }
.jg.is-laid::after { display: none; }
/* Hide the rough layout until site.js has balanced the rows, but reveal it
   anyway after a moment in case the script never runs. */
html.js .jg:not(.is-laid) { opacity: 0; animation: jg-reveal 0s 1.5s forwards; }
@keyframes jg-reveal { to { opacity: 1; } }

/* ---------- Home ---------- */
.hero { padding: 0 var(--pad); }
.hero-ph img {
  height: auto;
  max-height: calc(100svh - var(--header-h) - 24px);
  min-height: 280px;
}
.intro { padding: clamp(40px, 7vw, 104px) var(--pad) clamp(40px, 6vw, 88px); }
.nw { white-space: nowrap; }
.headline {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.intro .sub { margin: 18px 0 0; color: var(--muted); font-size: clamp(15px, 1.2vw, 18px); }

.section { padding: 0 var(--pad) clamp(64px, 9vw, 128px); }

/* Album covers: justified rows like the photo grids, so covers aren't cropped. */
.jg.albums { row-gap: clamp(24px, 2.4vw, 36px); }
.album-card { display: block; }
.jg > .album-card {
  flex-grow: calc(var(--ar) * 100);
  flex-basis: calc(var(--ar) * var(--row));
  min-width: 0;
}
.album-card .cover { aspect-ratio: var(--ar); overflow: hidden; background: var(--c, var(--tile)); }
.album-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (hover: hover) { .album-card:hover img { transform: scale(1.03); } }
.album-card .meta { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; }
.album-card .title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.album-card .count { color: var(--muted); font-size: 13px; }
@media (max-width: 719px) {
  .album-card .meta { display: block; padding-top: 10px; }
  .album-card .title { display: block; font-size: 16px; }
}

.contact {
  margin: 0 var(--pad);
  padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 9vw, 120px);
  border-top: 1px solid var(--line);
}
.contact-lede {
  max-width: 20ch;
  margin: 0 0 28px;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.contact-links { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.contact-link {
  font-size: clamp(16px, 1.5vw, 20px);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.contact-link:hover { border-color: var(--fg); }

/* ---------- Album page ---------- */
.album-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  padding: clamp(32px, 6vw, 88px) var(--pad) clamp(24px, 3vw, 44px);
}
.album-head h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.035em;
}
.album-head .desc { max-width: 54ch; margin: 18px 0 0; color: var(--muted); }
.album-head .count { margin: 0; color: var(--muted); font-size: 14px; }
.notfound { min-height: 50vh; align-items: flex-start; }

.album-pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0 var(--pad);
  padding: clamp(32px, 5vw, 64px) 0 clamp(48px, 7vw, 96px);
  border-top: 1px solid var(--line);
}
.album-pager a { display: flex; flex-direction: column; gap: 6px; }
.album-pager .next { text-align: right; margin-left: auto; }
.album-pager .k { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.album-pager .v { font-size: clamp(20px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; transition: color 0.2s; }
.album-pager a:hover .v { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 28px var(--pad) calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.album .site-footer, .home .site-footer { border-top: 0; }
.to-top:hover { color: var(--fg); }

/* ---------- Lightbox ---------- */
.pswp { --pswp-bg: #0b0b0b; }
.pswp img { -webkit-touch-callout: none; user-select: none; }
.pswp__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
