:root {
  color-scheme: dark;
  --background: #080808;
  --surface: #11110f;
  --text: #f0eee7;
  --muted: #a4a098;
  --line: #292825;
  --gap: clamp(0.55rem, 0.75vw, 0.85rem);
}

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

html {
  background: var(--background);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 20rem;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.is-lightbox-open {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--background);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.work {
  padding: var(--gap);
}

.gallery {
  --columns: 2;
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: var(--gap);
  align-items: start;
}

.gallery.is-masonry {
  position: relative;
  display: block;
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1px;
  background: var(--surface);
  cursor: zoom-in;
  isolation: isolate;
}

.gallery-item:nth-child(1) { aspect-ratio: 0.78878; }
.gallery-item:nth-child(2) { aspect-ratio: 0.78809; }
.gallery-item:nth-child(3) { aspect-ratio: 1.52918; }
.gallery-item:nth-child(4) { aspect-ratio: 0.8; }
.gallery-item:nth-child(5) { aspect-ratio: 0.8; }
.gallery-item:nth-child(6) { aspect-ratio: 1; }
.gallery-item:nth-child(7) { aspect-ratio: 0.74257; }
.gallery-item:nth-child(8) { aspect-ratio: 0.74503; }
.gallery-item:nth-child(9) { aspect-ratio: 0.78413; }
.gallery-item:nth-child(10) { aspect-ratio: 0.74596; }
.gallery-item:nth-child(11) { aspect-ratio: 0.99119; }
.gallery-item:nth-child(12) { aspect-ratio: 0.80218; }
.gallery-item:nth-child(13) { aspect-ratio: 1.27208; }
.gallery-item:nth-child(14) { aspect-ratio: 0.74875; }
.gallery-item:nth-child(15) { aspect-ratio: 0.71457; }
.gallery-item:nth-child(16) { aspect-ratio: 1.09756; }

.gallery.is-masonry .gallery-item {
  position: absolute;
  top: 0;
  left: 0;
  aspect-ratio: auto;
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgb(255 255 255 / 0.15);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 250ms ease;
}

.gallery-item:hover img {
  transform: scale(1.012);
  filter: brightness(1.035);
}

.gallery-item.is-transition-source img {
  visibility: hidden;
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  opacity: 1;
}

.gallery-item:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -3px;
}

.about {
  display: grid;
  grid-template-columns: minmax(17rem, 0.85fr) minmax(20rem, 1.15fr);
  gap: clamp(3rem, 9vw, 9rem);
  align-items: center;
  width: min(76rem, calc(100% - 2.5rem));
  margin: clamp(8rem, 15vw, 15rem) auto clamp(4rem, 8vw, 8rem);
  padding-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}

.about-portrait img {
  display: block;
  width: 100%;
  height: auto;
}

.about-copy {
  max-width: 42rem;
}

.eyebrow {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.about h2 {
  margin: 0 0 clamp(1.75rem, 3vw, 3rem);
  font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.055em;
}

.about-copy > p:not(.eyebrow) {
  margin: 0 0 1.1rem;
  color: #cbc8c0;
  font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  line-height: 1.62;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.65rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.contact-links a {
  padding-block: 0.4rem;
  border-bottom: 1px solid #56534c;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 150ms ease, color 150ms ease;
}

.contact-links a span {
  display: inline-block;
  margin-left: 0.15rem;
  color: var(--muted);
  transition: transform 150ms ease;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  border-color: var(--text);
  color: #fff;
}

.contact-links a:hover span,
.contact-links a:focus-visible span {
  transform: translate(2px, -2px);
}

.lightbox {
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
  transition: background-color 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox::backdrop {
  background: transparent;
  transition: background-color 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.is-visible {
  background-color: rgb(5 5 5 / 0.97);
}

.lightbox.is-visible::backdrop {
  background-color: rgb(0 0 0 / 0.95);
}

.lightbox-stage {
  position: absolute;
  inset: clamp(3.75rem, 7vw, 5.25rem) clamp(3.5rem, 7vw, 7rem) clamp(5.25rem, 9vw, 6.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
}

.lightbox-stage.is-zoomed {
  cursor: grab;
}

.lightbox-stage.is-dragging {
  cursor: grabbing;
}

.lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
  transition: opacity 140ms ease;
}

.lightbox.is-transitioning .lightbox-stage img {
  opacity: 0;
}

.lightbox-transition-image {
  position: fixed;
  z-index: 5;
  display: block;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
  pointer-events: none;
  will-change: left, top, width, height, opacity;
}

.lightbox-button,
.lightbox-toolbar button {
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.2);
  background: rgb(10 10 10 / 0.7);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 150ms ease, border-color 150ms ease, opacity 180ms ease;
}

.lightbox-toolbar,
.lightbox-count,
.lightbox-help {
  transition: opacity 180ms ease;
}

.lightbox.is-transitioning > .lightbox-button,
.lightbox.is-transitioning > .lightbox-toolbar,
.lightbox.is-transitioning > .lightbox-count,
.lightbox.is-transitioning > .lightbox-help {
  opacity: 0;
  pointer-events: none;
}

.lightbox-button:hover,
.lightbox-toolbar button:hover,
.lightbox-button:focus-visible,
.lightbox-toolbar button:focus-visible {
  border-color: rgb(255 255 255 / 0.7);
  background: rgb(34 34 31 / 0.88);
  outline: none;
}

.lightbox-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
}

.lightbox-close svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.lightbox-previous,
.lightbox-next {
  position: absolute;
  top: 50%;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  font-size: 1.15rem;
  transform: translateY(-50%);
}

.lightbox-previous {
  left: max(1rem, env(safe-area-inset-left));
}

.lightbox-next {
  right: max(1rem, env(safe-area-inset-right));
}

.lightbox-toolbar {
  position: absolute;
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  transform: translateX(-50%);
}

.lightbox-toolbar button {
  min-width: 2.75rem;
  height: 2.55rem;
  padding: 0 0.9rem;
  border-radius: 0;
  border-right: 0;
  font-size: 1.05rem;
}

.lightbox-toolbar button:first-child {
  border-radius: 999px 0 0 999px;
}

.lightbox-toolbar button:last-child {
  border-right: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 0 999px 999px 0;
}

.lightbox-toolbar button:disabled {
  opacity: 0.38;
  cursor: default;
}

#zoom-reset {
  min-width: 4.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.lightbox-count,
.lightbox-help {
  position: absolute;
  bottom: 1.65rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lightbox-count {
  left: max(1.25rem, env(safe-area-inset-left));
}

.lightbox-help {
  right: max(1.25rem, env(safe-area-inset-right));
}

@media (min-width: 900px) {
  .gallery {
    --columns: 3;
  }
}

@media (min-width: 1400px) {
  .gallery {
    --columns: 4;
  }
}

@media (max-width: 740px) {
  .about {
    grid-template-columns: 1fr;
    gap: 3.25rem;
    width: min(36rem, calc(100% - 2rem));
  }

  .about-portrait {
    width: min(25rem, 92%);
    margin-inline: auto;
  }

  .about h2 {
    font-size: clamp(3.5rem, 16vw, 5.5rem);
  }

  .lightbox-stage {
    inset: 3.8rem 0.5rem 6.25rem;
  }

  .lightbox-previous,
  .lightbox-next {
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .lightbox-previous {
    left: max(0.75rem, env(safe-area-inset-left));
  }

  .lightbox-next {
    right: max(0.75rem, env(safe-area-inset-right));
  }

  .lightbox-help {
    display: none;
  }

  .lightbox-count {
    bottom: 4.4rem;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 620px) {
  .gallery {
    --columns: 1;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
