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

:root {
  --sidebar-width: 170px;
}

body {
  background: #000;
  color: #fff;
  font-family: 'Lato', helvetica, arial, sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100%;
  padding: 2rem 1rem 2rem 1.5rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
}

header h1 {
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

header .tagline {
  margin-top: 1rem;
  font-size: 0.75rem;
  line-height: 1.6;
  opacity: 0.6;
}

header .links {
  display: flex;
  gap: 0.25rem;
  margin: 1rem 0 0 -0.5rem;
}

header .links a {
  display: flex;
  padding: 0.5rem;
  color: #fff;
  opacity: 0.6;
  transition: opacity 0.2s;
}

header .links a:hover,
header .links a:focus-visible {
  opacity: 1;
}

header .links svg {
  width: 1.375rem;
  height: 1.375rem;
}

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

@media (min-width: 641px) {
  html {
    scroll-snap-type: y proximity;
  }
}

/* One photo per screen: portraits and landscapes both fit without scrolling. */
figure {
  height: 100vh;
  height: 100dvh;
}

@media (min-width: 641px) {
  figure {
    scroll-snap-align: center;
  }
}

figure picture {
  display: contents;
}

figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* WebGL scroll transition (src/assets/js/scroll-gl.js). The figures stay as
   invisible scroll anchors while the canvas draws the photos. */
#gl {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  width: calc(100vw - var(--sidebar-width));
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  pointer-events: none;
  visibility: hidden;
}

html.gl #gl {
  visibility: visible;
}

html.gl figure img {
  opacity: 0;
}

.empty {
  padding: 4rem 2rem;
  opacity: 0.4;
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  #gl {
    left: 0;
    width: 100%;
  }

  /* The header sits over the first photo while the canvas is active: give it a
     solid dark band that fades out, so the text stays readable on bright photos. */
  html.gl header {
    padding-bottom: 3rem;
    background: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0, 0, 0, 0) 100%);
  }

  header {
    position: relative;
    width: 100%;
    height: auto;
    padding: 1.25rem 1rem;
  }

  main {
    margin-left: 0;
  }
}
