:root {
  --page-bg: #f5f3ee;
  --header-bg: #ebe8e1;
  --text-strong: #2f2e2b;
  --project-title: #3c3b37;
  --text: #514f4a;
  --text-muted: #6f6c66;
  --rule: #d8d5ce;
  --max-width: 1600px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.js .site-header,
.js main {
  opacity: 0;
}

.js .site-header {
  transition: opacity 300ms cubic-bezier(0.37, 0, 0.63, 1);
}

.js main {
  transition: opacity 360ms cubic-bezier(0.37, 0, 0.63, 1) 180ms;
}

.js.is-page-ready .site-header,
.js.is-page-ready main {
  opacity: 1;
}

.js.is-page-ready.is-page-leaving main {
  opacity: 0;
  transition: opacity 320ms cubic-bezier(0.37, 0, 0.63, 1);
}

.js.is-page-ready.is-page-leaving .site-header {
  opacity: 0;
  transition: opacity 280ms cubic-bezier(0.37, 0, 0.63, 1) 60ms;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 4vw;
  background: var(--header-bg);
  border-bottom: 1px solid var(--rule);
}

.site-header a {
  text-decoration: none;
}

.site-header .site-title {
  color: var(--text-strong);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header nav a {
  color: var(--text);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  color: var(--text-muted);
  font-size: 0.88em;
  letter-spacing: 0.04em;
}

.site-header nav .language-switcher a {
  color: var(--text-muted);
}

.site-header nav .language-switcher a[aria-current="page"] {
  color: var(--text-strong);
  font-weight: 600;
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 20px 4vw 18px;
    text-align: center;
  }

  .site-header nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }
}

main {
  width: min(92vw, var(--max-width));
  margin: 0 auto;
  padding-bottom: 80px;
}

h1,
h2,
h3 {
  color: var(--text-strong);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.home-page {
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.home-page main {
  min-height: 0;
  padding-bottom: 0;
}

.home-carousel {
  width: min(100%, 1440px);
  height: 100%;
  position: relative;
  margin: 0 auto;
  padding: clamp(24px, 3vh, 40px) 0 clamp(58px, 7vh, 76px);
}

.home-carousel__viewport {
  height: 100%;
  display: grid;
}

.home-feature {
  grid-area: 1 / 1;
  min-height: 0;
  position: relative;
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 550ms cubic-bezier(0.45, 0, 0.55, 1),
    visibility 0s linear 550ms;
}

.home-feature.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.home-feature__copy {
  z-index: 2;
  width: min(52%, 620px);
  align-self: center;
  justify-self: center;
  text-align: center;
}

.home-feature__copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.home-feature__heading .project-meta {
  margin: 0.35rem 0 0;
}

.home-feature__description {
  max-width: 55ch;
  margin: 0.9rem auto 0;
  overflow-wrap: anywhere;
}

.home-feature__more {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.25em;
}

.home-feature__more:hover {
  text-decoration-color: currentColor;
}

.home-feature__more:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.home-feature__media {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  overflow: hidden;
}

.home-feature__thumbnail {
  position: absolute;
  display: block;
  width: var(--home-thumbnail-size, 96px);
  aspect-ratio: 1;
  color: inherit;
  opacity: 0;
  transition:
    opacity 360ms cubic-bezier(0.37, 0, 0.63, 1)
    var(--home-thumbnail-out-delay, 0ms);
}

.home-feature.is-active.are-thumbnails-visible:not(.are-thumbnails-exiting)
  .home-feature__thumbnail {
  opacity: 1;
  transition-delay: var(--home-thumbnail-in-delay, 0ms);
}

.home-feature.are-thumbnails-exiting .home-feature__thumbnail {
  pointer-events: none;
}

.home-feature__thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-feature__thumbnail:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.home-carousel__footer {
  position: absolute;
  right: 0;
  bottom: clamp(18px, 2.5vh, 32px);
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.home-carousel__progress {
  height: 1px;
  overflow: hidden;
  background: var(--rule);
}

.home-carousel__progress-value {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--text-muted);
  transform: scaleX(0);
  transform-origin: left center;
}

.home-carousel.is-enhanced.is-cycling .home-carousel__progress-value {
  animation: home-carousel-progress 4s linear forwards;
}

.home-carousel.is-paused .home-carousel__progress-value {
  animation-play-state: paused;
}

.home-carousel__toggle {
  display: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.home-carousel.is-enhanced .home-carousel__toggle {
  display: block;
}

.home-carousel__toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

@keyframes home-carousel-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 800px) {
  .home-carousel {
    padding: clamp(20px, 3vh, 30px) 0 clamp(52px, 6vh, 62px);
  }

  .home-feature {
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(14px, 2vh, 22px);
  }

  .home-feature__copy {
    grid-row: 1;
    width: min(100%, 480px);
    align-self: center;
    justify-self: center;
  }

  .home-feature__media {
    grid-row: 2;
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, var(--home-mobile-thumbnail-size, 88px));
    gap: 8px;
    align-content: center;
    justify-content: center;
  }

  .home-feature__copy h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .home-feature__description {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .home-feature__thumbnail {
    position: relative;
    width: var(--home-mobile-thumbnail-size, 88px);
    left: auto;
    top: auto;
  }

  .home-carousel__footer {
    bottom: clamp(16px, 2vh, 24px);
    gap: 12px;
  }
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}

.project-list--work {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.project-list--work .project-card {
  flex: 0 1 calc((100% - 64px) / 3);
  max-width: 420px;
}

.js .project-list--work .project-card {
  opacity: 0;
}

.js.is-page-ready .project-list--work .project-card {
  animation: work-card-reveal 600ms cubic-bezier(0.37, 0, 0.63, 1) both;
  animation-delay: var(--card-delay);
}

@keyframes work-card-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .project-list--work {
    flex-direction: column;
    align-items: center;
  }

  .project-list--work .project-card {
    flex: none;
    width: 100%;
    max-width: 420px;
  }
}

.project-card {
  min-width: 0;
}

.project-card a {
  color: inherit;
  text-decoration: none;
}

.project-card__cover {
  position: relative;
  width: 66.666%;
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
}

.project-card__cover img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__details {
  max-width: 420px;
  margin-top: 20px;
}

.project-card__details h2 {
  margin: 0;
  text-align: center;
}

.project-card__details .project-meta {
  margin: 0.35rem 0 0;
  text-align: center;
}

.project-card__description {
  margin: 0.9rem 0 0;
  text-align: center;
  text-wrap: pretty;
}

.project-meta {
  color: var(--text-muted);
}

body.project-page {
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.project-page main {
  min-height: 0;
  padding-bottom: 0;
}

.project-gallery {
  --gallery-fade-duration: 550ms;
  width: min(100%, 1440px);
  height: 100%;
  min-height: 0;
  position: relative;
  margin: 0 auto;
  padding: clamp(24px, 3vh, 40px) 0 clamp(58px, 7vh, 76px);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.project-gallery__intro {
  min-width: 0;
  width: 100%;
  align-self: center;
}

.project-gallery__intro h1,
.project-gallery__intro h2 {
  margin: 0;
  color: var(--project-title);
}

.project-gallery__intro-cover {
  display: none;
}

.project-gallery__intro h1 {
  font-size: clamp(1.67rem, 3.25vw, 2.95rem);
}

.project-gallery__intro h2 {
  font-size: clamp(0.875rem, 1.15vw, 1.125rem);
  font-style: italic;
}

.project-gallery__year,
.project-gallery__description {
  margin: 0;
}

.project-gallery__year {
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 0.55rem;
}

.project-gallery__description {
  max-width: 90ch;
  margin-top: 0.9rem;
}

.project-gallery__description--statement > :first-child {
  margin-top: 0;
}

.project-gallery__description--statement > :last-child {
  margin-bottom: 0;
}

.project-gallery__description--statement > p {
  margin: 0.9rem 0 0;
}

.project-gallery__description--statement blockquote {
  margin: 0 0 1.35rem;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 1px solid var(--rule);
  color: var(--text-muted);
}

.project-gallery__description--statement blockquote p {
  margin: 0;
}

.project-gallery__description--statement blockquote p + p {
  margin-top: 0.45rem;
}

.project-gallery__description--statement a {
  color: var(--text-strong);
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

.project-gallery__description--statement a:hover {
  text-decoration-color: currentColor;
}

.project-gallery__description--statement a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.project-gallery__stage {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(180px, 1fr);
  column-gap: clamp(24px, 3.5vw, 56px);
  row-gap: 0;
  align-items: stretch;
  min-height: 0;
}

.project-gallery:not(.is-overview) .project-gallery__media {
  grid-column: 1;
  grid-row: 1 / -1;
}

.project-gallery:not(.is-overview) .project-gallery__intro {
  grid-area: 1 / 2;
  align-self: end;
}

.project-gallery:not(.is-overview) .project-gallery__stage {
  grid-template-rows:
    var(--gallery-image-bottom, 100%)
    minmax(0, 1fr);
}

.project-gallery.is-overview .project-gallery__stage {
  grid-template-columns: minmax(0, 1fr);
}

.project-gallery.is-overview .project-gallery__intro,
.project-gallery.is-overview .project-gallery__media {
  grid-area: 1 / 1;
}

.project-gallery.is-overview .project-gallery__intro {
  z-index: 2;
  width: min(52%, 620px);
  align-self: center;
  justify-self: center;
  text-align: center;
}

.project-gallery__details {
  position: relative;
}

.project-gallery__detail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--gallery-fade-duration) cubic-bezier(0.45, 0, 0.55, 1),
    visibility 0s linear var(--gallery-fade-duration);
}

.project-gallery__detail.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.project-gallery__detail.is-active.is-exiting {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
}

.project-gallery.is-overview .project-gallery__detail {
  text-align: center;
}

.project-gallery.is-overview .project-gallery__heading {
  display: block;
}

.project-gallery.is-overview .project-gallery__year {
  margin-top: 0.35rem;
}

.project-gallery.is-overview .project-gallery__description {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  overflow-wrap: anywhere;
}

.project-gallery__start {
  display: none;
  margin-top: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.25em;
}

.project-gallery.is-enhanced .project-gallery__start {
  display: inline-block;
}

.project-gallery.is-enhanced .project-gallery__start--mobile {
  display: none;
}

.project-gallery__start:hover {
  text-decoration-color: currentColor;
}

.project-gallery__start:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.project-gallery__media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.project-gallery__overview,
.project-gallery__image {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--gallery-fade-duration) cubic-bezier(0.45, 0, 0.55, 1),
    visibility 0s linear var(--gallery-fade-duration);
}

.project-gallery__overview.is-active,
.project-gallery__image.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.project-gallery__overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 140px));
  gap: 14px;
  align-content: center;
  justify-content: center;
}

.project-gallery.is-overview .project-gallery__overview {
  display: block;
}

.project-gallery.is-overview .project-gallery__thumbnail {
  position: absolute;
  width: var(--thumbnail-size, 96px);
  opacity: 0;
  transition:
    opacity 360ms cubic-bezier(0.37, 0, 0.63, 1)
    var(--thumbnail-out-delay, 0ms);
}

.project-gallery.is-overview.are-thumbnails-visible:not(.are-thumbnails-exiting)
  .project-gallery__thumbnail {
  opacity: 1;
  transition-delay: var(--thumbnail-in-delay, 0ms);
}

.project-gallery.are-thumbnails-exiting .project-gallery__thumbnail,
.project-gallery.are-thumbnails-exiting .project-gallery__start {
  pointer-events: none;
}

.project-gallery__thumbnail {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
}

.project-gallery.is-enhanced .project-gallery__thumbnail {
  cursor: pointer;
}

.project-gallery__thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-gallery__thumbnail:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.project-gallery__image {
  margin: 0;
}

.project-gallery__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-gallery__controls {
  position: absolute;
  right: 0;
  bottom: clamp(18px, 2.5vh, 32px);
  left: 0;
  display: none;
  grid-template-columns: auto 1fr auto auto;
  gap: 18px;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 300ms ease,
    visibility 0s linear 0s;
}

.project-gallery.is-enhanced .project-gallery__controls {
  display: grid;
}

.project-gallery.is-overview .project-gallery__controls {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 300ms ease,
    visibility 0s linear 300ms;
}

.project-gallery__controls button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.project-gallery__controls button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.project-gallery__progress {
  height: 1px;
  overflow: hidden;
  background: var(--rule);
}

.project-gallery__progress-value {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--text-muted);
  transform: scaleX(0);
  transform-origin: left center;
}

.project-gallery.is-enhanced.is-cycling .project-gallery__progress-value {
  animation: project-gallery-progress 10s linear forwards;
}

.project-gallery.is-paused .project-gallery__progress-value {
  animation-play-state: paused;
}

@keyframes project-gallery-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 800px) {
  .work-page .page-header {
    text-align: center;
  }

  .project-gallery {
    padding: clamp(20px, 3vh, 30px) 0 clamp(52px, 6vh, 62px);
  }

  .project-gallery__stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(14px, 2vh, 22px);
  }

  .project-gallery:not(.is-overview) .project-gallery__stage {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .project-gallery:not(.is-overview) .project-gallery__media {
    grid-area: 1 / 1;
  }

  .project-gallery:not(.is-overview) .project-gallery__intro {
    grid-area: 2 / 1;
    align-self: stretch;
  }

  .project-gallery__intro {
    align-self: stretch;
  }

  .project-gallery.is-overview .project-gallery__intro {
    grid-area: 1 / 1;
    width: min(100%, 480px);
    align-self: center;
  }

  .project-gallery.is-overview .project-gallery__intro-cover {
    display: block;
    width: clamp(64px, 18vw, 88px);
    aspect-ratio: 1;
    margin: 0 auto 0.75rem;
    overflow: hidden;
  }

  .project-gallery__intro-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .project-gallery.is-enhanced .project-gallery__start--mobile {
    display: inline-block;
    margin-top: 0.7rem;
    font-size: 0.78rem;
  }

  .project-gallery__start--desktop {
    margin-bottom: 1.25rem;
    font-size: 0.78rem;
  }

  .project-gallery__start--mobile + .project-gallery__description {
    margin-top: 0.8rem;
  }

  .project-gallery.is-overview .project-gallery__media {
    grid-area: 2 / 1;
  }

  .project-gallery.is-overview .project-gallery__overview {
    display: grid;
    grid-template-columns: repeat(3, var(--mobile-thumbnail-size, 88px));
    gap: 8px;
    align-content: center;
    justify-content: center;
  }

  .project-gallery.is-overview .project-gallery__thumbnail {
    position: relative;
    width: var(--mobile-thumbnail-size, 88px);
    left: auto;
    top: auto;
  }

  .project-gallery__detail {
    max-width: 100%;
  }

  .project-gallery__heading {
    display: flex;
    gap: 8px;
    align-items: baseline;
    justify-content: center;
    text-align: center;
  }

  .project-gallery__description {
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    overflow-wrap: anywhere;
  }

  .project-gallery:not(.is-overview) .project-gallery__description {
    text-align: center;
  }

  .project-gallery__intro h1 {
    font-size: clamp(1.06rem, 4.5vw, 1.45rem);
  }

  .project-gallery__intro h2 {
    font-size: clamp(0.95rem, 4.05vw, 1.3rem);
  }

  .project-gallery__year,
  .project-gallery__description {
    margin-top: 0;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .project-gallery__media {
    width: 100%;
    height: 100%;
  }

  .project-gallery__overview {
    grid-template-columns: repeat(auto-fit, minmax(64px, 92px));
    gap: 8px;
  }

  .project-gallery__controls {
    bottom: clamp(16px, 2vh, 24px);
    gap: 12px;
  }
}

.page-header {
  padding: 8vh 0 6vh;
}

.text-page {
  max-width: 760px;
  padding: 8vh 0;
}

.text-page h1 {
  margin-top: 0;
}

.contact-email {
  margin-top: 2rem;
}

.contact-email__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  color: var(--text-strong);
  opacity: 1;
  transition-property: opacity;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
  text-underline-offset: 0.2em;
}

.contact-email__icon {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

.contact-email__link.is-changing {
  opacity: 0;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
}

.contact-email__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.contact-email__status {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 360ms cubic-bezier(0.37, 0, 0.63, 1) 80ms;
}

.contact-email__status.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .js .site-header,
  .js main,
  .js .project-list--work .project-card {
    opacity: 1;
    animation: none;
    transition: none;
  }

  .home-feature,
  .home-feature__thumbnail {
    transition: none;
  }

  .home-carousel__progress-value {
    animation: none !important;
  }

  .project-gallery__detail,
  .project-gallery__overview,
  .project-gallery__image,
  .project-gallery__thumbnail {
    transition: none;
  }

  .project-gallery__progress-value {
    animation: none !important;
  }

  .contact-email__link,
  .contact-email__status {
    transition: none;
  }
}
