:root {
  --sidebar: 220px;
  --cap: 80px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Open Sans", sans-serif;
  --font-head: "Segoe UI", Arial, sans-serif;
  --font-nav: Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 15px/1.8 var(--font);
  color: #666;
  background: #fff;
}

a { color: inherit; text-decoration: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding-top: 52px;
  overflow: auto;
  background: #fff;
  z-index: 30;
  transition: transform .45s var(--ease);
}

.brand {
  display: block;
  margin: 0 0 44px;
  padding: 0 36px;
  font: 300 20px/1.3 var(--font-nav);
  letter-spacing: .02em;
  color: #000;
}

.nav-link {
  position: relative;
  display: block;
  width: max-content;
  margin: 0 36px;
  padding: 7px 0;
  font: 400 11px/1.6 var(--font-nav);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8c8c8c;
  transition: color .3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 3px;
  width: calc(100% - .1em);
  height: 1px;
  background: #000;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}

.nav-link:hover,
.nav-link[aria-current="page"] { color: #000; }

.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }

.topbar {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #fff;
  z-index: 20;
}

.topbar .brand { margin: 0; padding: 0; font-size: 18px; }

.menu-btn {
  position: relative;
  width: 52px;
  height: 44px;
  margin-right: -12px;
  font-size: 0;
  color: #000;
  cursor: pointer;
  transition: opacity .3s ease;
}

.menu-btn::before,
.menu-btn::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1px;
  background: #000;
}

.menu-btn::before { top: 17px; }
.menu-btn::after { bottom: 17px; }

.menu-btn:hover { opacity: .5; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease);
  z-index: 25;
}

main { margin-left: var(--sidebar); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #f5f5f5;
  cursor: pointer;
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 1px;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease, filter .2s ease;
}

.thumb img.loaded { opacity: 1; }
.thumb:hover img.loaded { filter: brightness(.5); }
.thumb:focus { outline: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  touch-action: pinch-zoom;
  visibility: hidden;
  transition: visibility 0s .4s;
}

.lightbox.open { visibility: visible; transition: none; }
.lightbox:focus { outline: none; }

.lightbox::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  transition: opacity .35s ease;
}

.lightbox.open::before { opacity: 1; }

.lb-img {
  position: absolute;
  object-fit: cover;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox.max .lb-img { cursor: zoom-out; }

.caption {
  position: absolute;
  inset: auto 0 0 0;
  height: var(--cap);
  margin: 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: #000;
  opacity: 0;
  transition: opacity .35s ease;
}

.lb-btn {
  position: absolute;
  border: 0;
  background: none;
  color: #000;
  font: 300 28px/1 var(--font);
  cursor: pointer;
  opacity: 0;
  transition: opacity .35s ease;
}

.lightbox.open .caption,
.lightbox.open .lb-btn { opacity: 1; }

.lb-close {
  top: 0;
  right: 0;
  z-index: 3;
  padding: 14px 18px;
}

.lb-close:hover { opacity: .5; }

.lb-prev, .lb-next {
  top: 0;
  bottom: var(--cap);
  z-index: 2;
  width: 25%;
  min-width: 90px;
  display: flex;
  align-items: center;
  font-size: 38px;
  padding: 0 24px;
}

.lb-prev { left: 0; justify-content: flex-start; }
.lb-next { right: 0; justify-content: flex-end; }

.lb-prev:hover, .lb-next:hover { color: #000; }
.lb-prev span, .lb-next span { transition: opacity .2s ease; }

.lb-prev.off, .lb-next.off { cursor: default; }
.lb-prev.off span, .lb-next.off span,
.lb-prev.off:hover span, .lb-next.off:hover span { opacity: 0; }

.lightbox.max .caption { opacity: 0; pointer-events: none; }
.lightbox.max .lb-prev, .lightbox.max .lb-next { bottom: 0; }

.slideshow {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar);   /* was: inset: 0 */
  margin: 0;
  overflow: hidden;
  background: #fff;
  user-select: none;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateX(100%);
  transition: transform .3s ease-in-out, filter .3s ease-in-out;
  will-change: transform;
  z-index: 0;
}

.slide.active { transform: none; z-index: 1; }

.slide.in { z-index: 2; }
.slide.out { z-index: 1; filter: brightness(.75); }

.slide.pre { opacity: 0; }
.slide.fade { animation: fade-in 1s ease both; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes sidebar-in { from { transform: translateX(-100%); } to { transform: none; } }

@media (min-width: 993px) {
  .intro .sidebar { animation: sidebar-in .35s var(--ease) both; }
}

.progress {
  height: 1px;
  background: #e4e4e4;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: #000;
  transform: scaleX(0);
  transform-origin: left;
}

.sidebar .progress { margin: 44px 36px 0; }
.topbar .progress { position: absolute; inset: 0 0 auto 0; height: 3px; background: rgba(0, 0, 0, .08); }

.count {
  margin: 10px 36px 0;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .1em;
  color: #999;
  font-variant-numeric: tabular-nums;
}

.zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border: 0;
  background: none;
  z-index: 2;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.zone.prev { left: 0; cursor: w-resize; }
.zone.next { right: 0; cursor: e-resize; }

.contact {
  padding: 32px 30px 64px;
  font-size: 12px;
  color: #000;
}

.contact img {
  display: block;
  width: 100%;
  max-width: 365px;
  height: auto;
  padding: 19px 0 32px;
}

.contact p { max-width: 365px; margin: 0; }

.contact a { transition: color .2s; }
.contact a:hover { color: #d00; }

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .menu-toggle:checked ~ .sidebar { transform: none; }
  .menu-toggle:checked ~ .overlay { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; }
  main { margin-left: 0; }
  main:not(.slideshow) { padding-top: 80px; }
  .slideshow { left: 0; }
}

@media (max-width: 600px) {
  :root { --cap: 110px; }
  .grid { grid-template-columns: 1fr; }
  .lb-prev, .lb-next { width: 30%; min-width: 0; padding: 0 12px; font-size: 32px; }
  .lb-prev span, .lb-next span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
}
