* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #111;
  font-family: "neue-haas-grotesk-display", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.1;
  transition: color 180ms ease-out;
}

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

a:hover {
  text-decoration: underline;
}

header a:hover,
header a:focus-visible {
  text-decoration: none;
}

/* Header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.site-header a {
  transition: color 180ms ease-out, filter 250ms ease, text-shadow 180ms ease-out;
}

/* Home page */

.homepage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 16px;
}

.project-list {
  display: flex;
  flex-direction: column;
}

.project-list h2 {
  margin: 0 0 16px;
  transition: filter 250ms ease;
}

/* Category labels on Home and project pages */
.project-list h2,
.project-switcher-heading,
.project-facts dt {
  font-size: 16px;
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.10em;
}

/* Project titles */
.homepage .project-list a {
  width: max-content;
  max-width: 100%;
  filter: blur(0);
  transition: filter 250ms ease, text-shadow 180ms ease-out;
}

/* Keep the active project title sharp and soften all other homepage text. */
body:has(.homepage .project-list a:is(:hover, :focus-visible)) .site-header a,
.homepage:has(.project-list a:is(:hover, :focus-visible)) .project-list h2 {
  filter: blur(2.5px);
}

.homepage:has(.project-list a:is(:hover, :focus-visible))
.project-list a:not(:hover):not(:focus-visible) {
  filter: blur(2.5px);
}

/* Active title */
.homepage .project-list a:is(:hover, :focus-visible) {
  text-decoration: none;
}

.photography {
  text-align: right;
}

.photography a {
  align-self: flex-end;
}

/* The project titles sit under their label. On phones the list is hidden
   until the label is tapped (see the small-screen rules). */
.project-list-menu {
  display: flex;
  flex-direction: column;
}

.photography .project-list-menu {
  align-items: flex-end;
}

body.slideshow-dark {
  color: #fff;
}

/* Home type over a picture. Same glow as the project menu, flipped when the
   picture behind it is light. */
body[data-page="home"] .site-header a,
.homepage .project-list-toggle,
.homepage .project-list a {
  text-shadow:
    0 0 1px #fff,
    0 0 4px rgba(255, 255, 255, 0.7);
}

body.slideshow-dark[data-page="home"] .site-header a,
body.slideshow-dark .homepage .project-list-toggle,
body.slideshow-dark .homepage .project-list a {
  text-shadow:
    0 0 1px #000,
    0 0 4px rgba(0, 0, 0, 0.7);
}

/* Home page images: hover previews and slideshow */

.background-stack {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.slideshow-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 550ms ease-in-out;
}

.slideshow-layer.visible {
  opacity: 1;
}

/* Optional framed preview (previewFrame in projects.js): the whole picture sits between the header and the footer. */
.slideshow-layer.is-project-frame {
  top: 26px;
  right: auto;
  bottom: 26px;
  left: 50%;
  width: auto;
  height: calc(100% - 52px);
  transform: translateX(-50%);
  object-fit: contain;
  object-position: center center;
}

body.slideshow-dark:has(.slideshow-layer.is-project-frame) .background-stack {
  background: #000;
}

/* Contact page */

.contact-page {
  min-height: 100vh;
}

.contact-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #fff;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 0 16px 16px;
}

.contact-header,
.contact-layout {
  animation: about-slide-in 1020ms
    cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes about-slide-in {
  from { transform: translate3d(0, 100vh, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .contact-header,
  .contact-layout {
    animation: none;
  }
}

.contact-intro {
  margin: 20.7px 0 0 48px;
  max-width: 720px;
}

.contact-intro p {
  margin: 0 0 16px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.contact-intro address {
  font-style: normal;
}

.contact-info {
  padding-top: 5.3px;
}

/* The header is a fixed white stripe. On a wide screen the columns start
   below it, so the text is not covered. */
@media (min-width: 801px) {
  .contact-layout {
    padding-top: 26px;
  }

  .contact-intro {
    margin-top: 0;
  }

  .contact-info {
    padding-top: 0;
  }
}

.contact-info h2 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.info-group,
.info-content p {
  margin: 0;
}

.info-content {
  margin-left: 48px;
}

html.about-overlay-page .contact-header,
html.about-overlay-page .contact-layout {
  animation: none;
}

.about-overlay-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  background: #fff;
  will-change: transform;
  animation: about-slide-in 1020ms
    cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.about-overlay-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.about-overlay-shell.is-closing {
  animation: about-overlay-exit 1020ms
    cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes about-overlay-exit {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, 100vh, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .about-overlay-shell,
  .about-overlay-shell.is-closing {
    animation: none;
  }
}

.info-row {
  display: grid;
  grid-template-columns: minmax(0, 245px) minmax(0, 154px) auto;
}

/* Project page */

.project-page {
  --details-height: 254px;
  overflow: hidden;
}

.project-header,
.project-footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 5;
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #fff;
}

.project-header {
  top: 0;
}

.project-contact {
  margin-left: auto;
}

.project-home {
  display: none;
}

.project-footer {
  bottom: 0;
  justify-content: flex-end;
}

.project-gallery {
  position: fixed;
  inset: 26px 0 26px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overflow-anchor: none;
  touch-action: pan-x;
  scrollbar-width: none;
  overscroll-behavior: none;
  transition: bottom 1020ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project-gallery::-webkit-scrollbar {
  -webkit-appearance: none;
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

/* Never show alt text / broken-image wireframes for images not yet loaded */
.project-gallery img[data-src] {
  visibility: hidden;
}

.project-footer .next-project {
  margin-left: auto;
}

.project-gallery img,
.project-gallery video {
  display: block;
  flex: none;
  width: auto;
  height: 100%;
  max-width: none;
  transform: translateZ(0);
}

.project-gallery.is-centered {
  justify-content: center;
}

.project-gallery img.is-half {
  height: 50%;
  align-self: center;
}

body[data-project="reflections"] .project-switcher,
body[data-project="reflections"] .project-switcher-heading,
body[data-project="reflections"] .project-switcher a,
body[data-project="reflections"] .project-title {
  color: #111;
  text-shadow: none;
}

.project-gallery picture {
  display: block;
  flex: none;
  width: max-content;
  height: 100%;
}

.project-gallery img.is-wide-gap {
  margin-inline-start: calc(150px - 12px);
}

.project-gallery img.is-flush,
.project-gallery picture.is-flush {
  margin-inline-start: -12px;
}

.project-gallery video {
  background: #000;
}

/* Safari leaves a 1px sliver past the last photograph. */
.project-gallery > :last-child {
  margin-inline-end: -1px;
}

/* A single film fills the area between the header and the footer. */
.project-gallery.is-full-bleed {
  display: block;
  overflow: hidden;
  direction: ltr;
  background: #000;
}

.project-gallery.is-full-bleed video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-page.details-open .project-gallery {
  bottom: calc(26px + var(--details-height));
}

/* Project information */

.project-details {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 26px;
  z-index: 3;
  height: var(--details-height);
  display: grid;
  align-items: baseline;
  grid-template-columns: fit-content(30vw) var(--description-width, minmax(0, 1fr));
  justify-content: end;
  gap: 32px;
  padding: 16px;
  background: #fff;
  pointer-events: none;
  will-change: clip-path;
  transition: clip-path 1020ms cubic-bezier(0.22, 1, 0.36, 1);
  clip-path: inset(100% 0 0 0);
}

.project-page.details-open .project-details {
  clip-path: inset(0 0 0 0);
  pointer-events: auto;
}

.project-details[hidden] {
  display: none;
}

.project-facts,
.project-facts dt,
.project-facts dd,
.project-description {
  margin: 0;
}

.project-facts,
.project-description {
  min-width: 0;
}

.project-facts div {
  display: grid;
  align-items: baseline;
  grid-template-columns: 100px minmax(min-content, 1fr);
}

.project-facts dt {
  line-height: 15.4px;
}

.project-description p {
  margin: 0 0 15px;
}

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

.project-description {
  justify-self: stretch;
  text-align: left;
  hyphens: auto;
}

.next-project,
.previous-project {
  text-decoration: none;
}

.next-project:hover,
.previous-project:hover {
  text-decoration: none;
}

/* Project menu (graphics and photography) */

.project-switcher {
  position: fixed;
  top: 50%;
  right: 16px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: right;
  transform: translateY(-50%);
  pointer-events: none;
  color: #fff;
  text-shadow:
    0 0 1px #000,
    0 0 4px rgba(0, 0, 0, 0.7);
}

.project-switcher-heading {
  margin-bottom: 16px;
  color: #fff;
}

.project-switcher-heading,
.project-switcher a:not(.project-title) {
  visibility: hidden;
}

.project-switcher .project-title {
  position: static;
  width: max-content;
  transform: none;
  pointer-events: auto;
}

.project-switcher:is(:hover, :focus-within) {
  pointer-events: auto;
}

.project-switcher:is(:hover, :focus-within) .project-switcher-heading,
.project-switcher:is(:hover, :focus-within) a {
  visibility: visible;
}

.project-switcher a {
  color: #fff;
  text-decoration: none;
  filter: blur(0);
  transition: filter 250ms ease;
}

/* Only the other titles blur */
.project-switcher:has(a:is(:hover, :focus-visible))
a:not(:hover):not(:focus-visible) {
  filter: blur(1.2px);
}

.project-switcher:has(a:is(:hover, :focus-visible))
.project-switcher-heading {
  filter: blur(1.2px);
}

/* Smaller screens */

@media (max-width: 800px) {
  body {
    font-size: 16px;
  }

  .project-facts dt {
    line-height: 1.1;
  }

  .site-header,
  .contact-header,
  .project-header,
  .project-footer {
    height: 44px;
  }

  .project-header .project-contact {
    display: none;
  }

  .project-header .project-home {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    margin-right: -16px;
  }

  .project-header .project-home::before,
  .project-header .project-home::after {
    content: "";
    grid-area: 1 / 1;
    width: 20px;
    height: 2.5px;
    background: currentColor;
  }

  .project-header .project-home::before {
    transform: rotate(45deg);
  }

  .project-header .project-home::after {
    transform: rotate(-45deg);
  }

  /* A tap has no hover. Underlines, the home-page blur and the project menu
     all wait for a tap instead. */
  a:hover {
    text-decoration: none;
  }

  body:has(.homepage .project-list a:is(:hover, :focus-visible)) .site-header a,
  .homepage:has(.project-list a:is(:hover, :focus-visible)) .project-list h2,
  .homepage:has(.project-list a:is(:hover, :focus-visible))
  .project-list a:not(:hover):not(:focus-visible),
  .project-switcher:has(a:is(:hover, :focus-visible)) a,
  .project-switcher:has(a:is(:hover, :focus-visible)) .project-switcher-heading {
    filter: none;
  }

  .project-switcher:is(:hover, :focus-within):not(.is-open) {
    pointer-events: none;
  }

  .project-switcher:not(.is-open) .project-title {
    pointer-events: auto;
  }

  .project-switcher:is(:hover, :focus-within):not(.is-open) .project-switcher-heading,
  .project-switcher:is(:hover, :focus-within):not(.is-open) a:not(.project-title) {
    visibility: hidden;
  }

  /* A project opens with the name and About off the page. They slide in
     only while the pictures are scrolling back up. */
  .project-header {
    transform: translateY(-100%);
    pointer-events: none;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .project-gallery {
    transition:
      top 320ms cubic-bezier(0.22, 1, 0.36, 1),
      bottom 1020ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.header-shown .project-header {
    transform: none;
    pointer-events: auto;
  }

  /* Home on phones: the first picture is already there, and the type stays
     white over every picture. Graphics is on the left, photography on the right. */
  body[data-page="home"] {
    color: #fff;
    background: #000 url("../assets/Home%20Screen/mobile/01.webp?v=13") center / cover no-repeat;
  }

  body[data-page="home"] .site-header a,
  body[data-page="home"].slideshow-dark .site-header a,
  body[data-page="home"] .homepage .project-list-toggle,
  body[data-page="home"] .homepage .project-list a,
  body[data-page="home"].slideshow-dark .homepage .project-list-toggle,
  body[data-page="home"].slideshow-dark .homepage .project-list a {
    color: #fff;
    text-shadow:
      0 0 1px #000,
      0 0 4px rgba(0, 0, 0, 0.7);
  }

  .homepage {
    min-height: 100dvh;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px;
  }

  .homepage .project-list {
    position: relative;
  }

  .homepage .project-list h2 {
    margin: 0;
  }

  .homepage .project-list-toggle {
    cursor: pointer;
    font-variant-caps: normal;
    letter-spacing: inherit;
    text-transform: capitalize;
  }

  .homepage .project-list-menu {
    display: flex;
    position: absolute;
    top: calc(100% + 16px);
    z-index: 2;
    max-width: calc(100vw - 32px);
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity 1020ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 1020ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 1020ms;
  }

  .homepage .graphics .project-list-menu {
    left: 0;
    align-items: flex-start;
  }

  .homepage .photography .project-list-menu {
    right: 0;
    left: auto;
  }

  .homepage .project-list.is-open .project-list-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition:
      opacity 1020ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 1020ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s;
  }

  @media (prefers-reduced-motion: reduce) {
    .homepage .project-list-toggle,
    .homepage .project-list-menu,
    .project-header,
    .project-gallery {
      transition: none;
    }

    .homepage .project-list.is-open .project-list-toggle,
    .homepage .project-list-menu {
      transform: none;
    }
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .contact-intro {
    margin: 52px 0 0;
    max-width: none;
  }

  .info-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 90px) auto;
    gap: 8px;
  }

  .project-gallery {
    inset: 0 0 44px;
    -webkit-overflow-scrolling: touch;
  }

  body.header-shown .project-gallery {
    top: 44px;
  }

  .slideshow-layer.is-project-frame {
    top: 44px;
    bottom: 44px;
    height: calc(100% - 88px);
  }

  .project-facts {
    width: min(100%, 60ch);
    margin-left: auto;
  }

  .project-description {
    margin-top: 24px;
  }

  .project-switcher.is-open {
    pointer-events: auto;
    background: none;
  }

  .project-switcher-heading {
    font-variant-caps: normal;
    letter-spacing: inherit;
    text-transform: capitalize;
  }

  .project-switcher.is-open .project-switcher-heading,
  .project-switcher.is-open a {
    visibility: visible;
  }
}

@media (max-width: 480px) {
  .info-content {
    margin-left: 24px;
  }

  .info-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .info-row span:nth-child(2) {
    display: none;
  }
}

/* I see you project treatment */
.i-see-you-page {
  background: #000;
  color: #fff;
}

.i-see-you-page .project-header,
.i-see-you-page .project-footer,
.i-see-you-page .project-details,
.i-see-you-page .project-gallery {
  background: #000;
}

.i-see-you-page .project-gallery {
  gap: 0;
}

html:has(body.dark-chrome) {
  background: #000;
  color-scheme: dark;
  overflow: hidden;
}

body.dark-chrome {
  background: #000;
  color: #fff;
}

.dark-chrome .project-header,
.dark-chrome .project-footer,
.dark-chrome .project-details {
  background: #000;
  color: #fff;
}

/* Next project slides in on top of the open project */
.next-project-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: transparent;
  pointer-events: none;
  transform: translate3d(100vw, 0, 0);
  transition: transform 1020ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  contain: paint;
  backface-visibility: hidden;
}

.next-project-layer.from-left {
  transform: translate3d(-100vw, 0, 0);
}

.next-project-layer.is-sliding {
  transform: translate3d(0, 0, 0);
}

.next-project-layer iframe {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.next-project-layer.is-dark,
.next-project-layer.is-dark iframe {
  background: #000;
}

.next-project-layer.is-dark.from-left {
  box-shadow: 4px 0 0 #000;
}

/* Graphics projects: project information sits on the left half */
.graphics-page .project-details {
  justify-content: start;
}

@media (min-width: 801px) {
  .graphics-page {
    --details-height: 330px;
  }
}

@media (max-width: 800px) {
  .graphics-page .project-details {
    padding: 24px 16px;
  }

  .graphics-page .project-facts {
    margin-left: 0;
  }
}

/* Graphics projects: project menu sits on the left, like on the home page */
.graphics-page .project-switcher {
  left: 16px;
  right: auto;
  align-items: flex-start;
  text-align: left;
  /* Declared after the small-screen rules on purpose: the open menu keeps its shadow here. */
  text-shadow:
    0 0 1px #000,
    0 0 4px rgba(0, 0, 0, 0.7);
}

/* Graphics galleries begin at the right and progress towards the left. */
.graphics-page .project-gallery {
  direction: rtl;
}

body[data-project="mdm"] .project-gallery {
  gap: 0;
}

body[data-project="cannes"] .project-gallery {
  align-items: center;
  justify-content: center;
  gap: 34px;
  background: #000;
}

body[data-project="cannes"] .project-gallery img {
  height: 71%;
}

/* Mirror footer navigation for graphics projects. */
.graphics-page .project-footer {
  flex-direction: row-reverse;
}

.graphics-page .project-footer .next-project {
  margin-left: 0;
  margin-right: auto;
}

/* Project pages on phones: the gallery scrolls up and down between the header
   and the footer, and the information follows the last picture
   (project-page.js puts it inside the gallery). */
@media (max-width: 800px) {
  .project-gallery,
  .graphics-page .project-gallery,
  body[data-project="cannes"] .project-gallery {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    direction: ltr;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y;
    gap: 0;
  }

  body[data-project="swimmers"] .project-gallery,
  body[data-project="in-the-air"] .project-gallery,
  body[data-project="beyond"] .project-gallery,
  body[data-project="plain-glass"] .project-gallery {
    gap: 8px;
  }

  .project-gallery.is-centered {
    justify-content: flex-start;
  }

  .project-gallery.is-full-bleed {
    display: flex;
  }

  .project-gallery img,
  .project-gallery picture,
  .project-gallery video,
  body[data-project="cannes"] .project-gallery img,
  .project-gallery img.is-half {
    width: 100%;
    height: auto;
    max-width: 100%;
    align-self: stretch;
    transform: none;
  }

  .project-gallery img.is-wide-gap,
  .project-gallery img.is-flush,
  .project-gallery picture.is-flush {
    margin-inline-start: 0;
  }

  .project-gallery img.is-flush,
  .project-gallery picture.is-flush {
    margin-top: -8px;
  }

  .project-details {
    position: static;
    z-index: auto;
    flex: none;
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
    padding: 24px 16px;
    pointer-events: auto;
    clip-path: none;
    transition: none;
    will-change: auto;
  }

  /* On a phone the floating title stays white, including over a light picture. */
  body[data-project="reflections"] .project-switcher,
  body[data-project="reflections"] .project-switcher-heading,
  body[data-project="reflections"] .project-switcher a,
  body[data-project="reflections"] .project-title {
    color: #fff;
    text-shadow:
      0 0 1px #000,
      0 0 4px rgba(0, 0, 0, 0.7);
  }
}
