/* Reset & base */

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

html {
  overflow-x: clip;
}

body {
  margin: 0;
  background: #fbfbfb;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: #ffc966;
  color: #000;
}

::-moz-selection {
  background-color: #ffc966;
  color: #000;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  color: #0000ee;
}

a:active,
a:focus-visible {
  font-style: italic;
  font-weight: bold;
}

/* Page layout */

.page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
}

.content {
  width: 100%;
}

/* Image gallery */

.gallery {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 4.5rem;
}

.gallery__item {
  margin: 0;
  flex-shrink: 0;
}

.gallery__item img {
  height: 15.5rem;
  width: auto;
  max-width: none;
}

/* Name */

.intro {
  margin-bottom: 3.25rem;
}

.name {
  margin: 0;
  font-size: clamp(1.5rem, 3.5vw, 1.875rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  user-select: none;
}

/* Bio */

.bio {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.bio p {
  margin: 0 0 1.5rem;
}

.bio p:last-child {
  margin-bottom: 0;
}

/* Responsive */

@media (max-width: 640px) {
  .page {
    padding: 2.5rem 1.25rem 3.5rem;
  }

  .gallery {
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding: 0 1.25rem 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .gallery::-webkit-scrollbar {
    display: none;
  }

  .gallery__item {
    scroll-snap-align: center;
  }

  .gallery__item img {
    height: 12rem;
  }

  .intro {
    margin-bottom: 2.5rem;
  }

  body {
    font-size: 1.0625rem;
  }
}

/* Tablet / small desktop — keep image row within viewport */

@media (min-width: 641px) and (max-width: 1099px) {
  .gallery {
    max-width: 100%;
  }

  .gallery__item img {
    height: auto;
    max-height: clamp(9rem, 16vw, 14rem);
    width: auto;
    max-width: calc((100vw - 6rem) / 3.2);
  }
}

/* Large screens — scattered images, centered text */

@media (min-width: 1100px) {
  .page {
    --content-half: 17rem;
    --content-gap: 1.25rem;

    max-width: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    margin: 0;
    padding: 4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: clip;
  }

  .gallery {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .gallery__item {
    position: absolute;
    pointer-events: auto;
    max-width: calc(50% - var(--content-half) - var(--content-gap));
  }

  .gallery__item--portrait {
    top: 6%;
    left: 5%;
  }

  .gallery__item--pool {
    top: 13%;
    right: 4%;
    left: auto;
  }

  .gallery__item--pottery {
    bottom: 8%;
    left: 12%;
  }

  .gallery__item img {
    width: auto;
    height: auto;
    max-height: 15.5rem;
    max-width: 100%;
  }

  .content {
    position: relative;
    z-index: 1;
    max-width: 34rem;
    padding: 0 1rem;
  }

  .intro {
    margin-bottom: 3.25rem;
  }
}

/* Interactive gallery (desktop, enabled by gallery.js) */

@media (min-width: 1100px) {
  .gallery--interactive .gallery__item {
    touch-action: none;
  }

  .gallery--interactive .gallery__item.is-selected {
    outline: none;
  }

  .gallery--interactive .gallery__item.is-selected img {
    pointer-events: none;
  }

  .gallery__selection {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.55);
    box-sizing: border-box;
  }

  .gallery__resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.65);
    box-sizing: border-box;
    pointer-events: auto;
    touch-action: none;
  }

  .gallery__resize-handle--nw {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
  }

  .gallery__resize-handle--ne {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
  }

  .gallery__resize-handle--sw {
    bottom: -5px;
    left: -5px;
    cursor: nesw-resize;
  }

  .gallery__resize-handle--se {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
  }

  .gallery__reset {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: rgba(0, 0, 0, 0.45);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
  }

  .gallery__reset-icon {
    display: flex;
    flex-shrink: 0;
  }

  .gallery__reset-icon svg {
    display: block;
    width: 0.9rem;
    height: 0.9rem;
  }

  .gallery__reset-label {
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }

  .gallery__reset:hover {
    color: #0000ee;
  }
}
