:root {
  --ink: #212121;
  --near-black: #0f0e12;
  --paper: #edece8;
  --white: #ffffff;
  --muted: #7f7a76;
  --red: #c32d30;
  --header-radius: 18px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: Everyday, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  overscroll-behavior-y: none;
}

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

a,
button {
  font: inherit;
}

.project-nav-shell {
  position: fixed;
  top: 30px;
  right: 30px;
  left: 30px;
  z-index: 30;
  height: 90px;
  overflow: hidden;
  border-radius: var(--header-radius);
  background: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition:
    height 720ms var(--ease-out),
    background-color 320ms ease;
}

.project-nav-shell:hover,
.project-nav-shell.is-menu-open {
  background: var(--white);
}

.project-nav-shell.is-menu-open {
  height: 50svh;
}

.project-hero-scroll {
  position: relative;
  z-index: 1;
  height: 70svh;
  background: var(--paper);
}

.project-hero-shell {
  position: relative;
  width: 100%;
  height: 70svh;
  overflow: hidden;
  clip-path: inset(0 round 0);
  background: var(--near-black);
  will-change: clip-path;
}

.project-hero__image,
.project-hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.project-hero__image {
  z-index: 0;
  object-fit: cover;
  object-position: center 58%;
  transform: scale(1.002);
  will-change: transform;
}

.project-hero__shade {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04) 42%, rgba(0, 0, 0, 0.68) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.32), transparent 58%);
  pointer-events: none;
}

.project-hero__copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 110px 40px 40px;
  color: var(--white);
  flex-direction: column;
  text-align: center;
}

.project-hero__copy h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.project-hero__lead {
  max-width: 30rem;
  margin: 0.75rem 0 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
}

.project-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 6;
  display: flex;
  height: 90px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 50px;
}

.project-header__logo {
  display: block;
}

.project-header__logo img {
  display: block;
  width: auto;
  height: 24px;
}

.project-menu-button {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.project-menu-button span {
  position: absolute;
  width: 22px;
  height: 1px;
  background: currentColor;
  transition:
    transform 320ms var(--ease-out),
    opacity 180ms ease;
}

.project-menu-button span:first-child {
  transform: translateY(-5px);
}

.project-menu-button span:last-child {
  transform: translateY(5px);
}

.project-nav-shell.is-menu-open .project-menu-button span:first-child {
  transform: rotate(45deg);
}

.project-nav-shell.is-menu-open .project-menu-button span:nth-child(2) {
  opacity: 0;
}

.project-nav-shell.is-menu-open .project-menu-button span:last-child {
  transform: rotate(-45deg);
}

.project-menu-button:focus-visible,
.project-header__logo:focus-visible,
.project-menu a:focus-visible {
  outline: 3px solid #1f73e0;
  outline-offset: 3px;
}

.project-menu {
  position: absolute;
  top: 90px;
  right: 50px;
  bottom: 30px;
  left: 50px;
  z-index: 5;
  display: grid;
  color: var(--ink);
  visibility: hidden;
  pointer-events: none;
  grid-template-columns: minmax(0, 3fr) minmax(16rem, 1fr);
  gap: clamp(64px, 8vw, 144px);
}

.project-nav-shell.is-menu-open .project-menu {
  visibility: visible;
  pointer-events: auto;
}

.project-menu nav {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.project-menu__item {
  opacity: 0;
  transform: translate3d(-12px, -10px, 0);
  transition:
    color 220ms ease,
    opacity 360ms ease,
    transform 620ms var(--ease-out);
}

.project-nav-shell.is-menu-open .project-menu__item {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: calc(180ms + (var(--order) * 62ms));
}

.project-menu nav a {
  color: inherit;
  font-size: clamp(1.75rem, 2.6vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.project-menu nav a:hover {
  color: var(--red);
}

.project-menu__context {
  padding-left: clamp(24px, 2.5vw, 40px);
  border-left: 1px solid rgba(33, 33, 33, 0.14);
}

.project-menu__context span {
  display: block;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.project-menu__context strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 400;
}

.project-menu__context p {
  max-width: 20rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.design-story {
  position: relative;
  min-height: calc(var(--story-count, 3) * 130svh);
  padding-top: 70px;
}

.design-story__sticky {
  position: sticky;
  top: 200px;
  z-index: 4;
  height: calc(100svh - 200px);
  min-height: 34rem;
  overflow: hidden;
  padding: 61px 50px 40px;
  background: transparent;
  pointer-events: none;
}

.design-story__progress {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(52rem, calc(100% - 100px));
  height: 1px;
  overflow: hidden;
  background: rgba(28, 28, 28, 0.06);
  transform: translateX(-50%);
}

.design-story__progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(28, 28, 28, 0.16);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.design-story__grid {
  display: grid;
  width: min(52rem, 100%);
  height: 100%;
  align-items: start;
  margin: 0 auto;
  grid-template-columns: 1fr;
  grid-template-rows: 3rem minmax(0, 1fr);
  gap: clamp(24px, 2.2vw, 36px);
}

.design-story__titles {
  position: relative;
  height: 3rem;
  padding: 0;
}

.design-story__title-stack {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
}

.design-story__title {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  opacity: 0;
  font-size: clamp(1.125rem, 1.35vw, 1.5rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.045em;
  transition: opacity 420ms ease;
}

.design-story__title.is-active {
  opacity: var(--story-title-opacity, 0.16);
}

.design-story__copy {
  position: relative;
  height: 100%;
  min-height: 22rem;
}

.design-story__text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 52rem;
  margin: 0;
  color: #1c1c1c;
  opacity: 0;
  font-size: clamp(1.625rem, 2.35vw, 2.75rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.045em;
  transition: opacity 280ms ease;
  pointer-events: none;
}

.design-story__text.is-active {
  opacity: 1;
}

.design-story__text--long {
  font-size: clamp(1.35rem, 1.85vw, 2.05rem);
  line-height: 1.08;
}

.design-story__text--very-long {
  font-size: clamp(1.15rem, 1.5vw, 1.65rem);
  line-height: 1.12;
}

.story-word {
  opacity: 0.13;
  transition: opacity 90ms linear;
}

.project-gallery {
  position: relative;
  z-index: 3;
  height: 420svh;
  margin-top: 0;
  background: transparent;
}

.project-gallery--story-linked {
  height: 790svh;
  margin-top: -370svh;
}

.project-gallery__sticky {
  position: sticky;
  top: 200px;
  height: calc(100svh - 200px);
  overflow: hidden;
}

.project-gallery__track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.project-gallery__slide {
  width: min(52rem, calc(100vw - 100px));
  aspect-ratio: 2 / 1;
  flex: 0 0 auto;
  overflow: hidden;
  margin: 0;
  border-radius: var(--header-radius);
  background: var(--near-black);
  opacity: 0.12;
  will-change: opacity;
}

.project-gallery__open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.project-gallery__open:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.9);
  outline-offset: -7px;
}

.project-gallery__slide img,
.project-gallery__slide video,
.project-gallery__slide iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--white);
  background: var(--near-black);
  opacity: 0;
  transition: opacity 260ms ease;
}

.project-lightbox:not([hidden]) {
  display: grid;
  place-items: center;
}

.project-lightbox.is-open {
  opacity: 1;
}

.project-lightbox__figure {
  display: grid;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 46px 76px 56px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 20px;
  place-items: center;
}

.project-lightbox__figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 132px);
  object-fit: contain;
  opacity: 0;
  transition: opacity 220ms ease;
}

.project-lightbox__figure img.is-ready {
  opacity: 1;
}

.project-lightbox__figure figcaption {
  display: flex;
  width: min(100%, 72rem);
  justify-content: space-between;
  gap: 24px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.project-lightbox__close,
.project-lightbox__arrow {
  position: absolute;
  z-index: 2;
  display: grid;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  place-items: center;
  transition: background-color 180ms ease;
}

.project-lightbox__close:hover,
.project-lightbox__arrow:hover,
.project-lightbox__close:focus-visible,
.project-lightbox__arrow:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.project-lightbox__close {
  top: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
}

.project-lightbox__close span {
  position: absolute;
  width: 17px;
  height: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.project-lightbox__close span:last-child {
  transform: rotate(-45deg);
}

.project-lightbox__arrow {
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
}

.project-lightbox__arrow--previous {
  left: 18px;
}

.project-lightbox__arrow--next {
  right: 18px;
}

.project-lightbox__arrow span {
  position: relative;
  width: 17px;
  height: 1px;
  background: currentColor;
}

.project-lightbox__arrow span::before {
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  content: "";
  transform: rotate(-45deg);
}

.project-lightbox__arrow--next span::before {
  right: 0;
  transform: rotate(135deg);
}

.project-lightbox__arrow--previous span::before {
  left: 0;
}

.project-specifications {
  position: relative;
  z-index: 5;
  padding: clamp(120px, 12vw, 184px) 50px;
  color: var(--ink);
  background: var(--paper);
}

.project-specifications__inner {
  width: min(52rem, 100%);
  margin: 0 auto;
}

.project-specifications h2 {
  margin: 0 0 clamp(48px, 6vw, 76px);
  font-size: clamp(1.125rem, 1.35vw, 1.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
}

.project-specifications__grid {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--spec-rows, 3), minmax(54px, auto));
  grid-auto-flow: column;
  column-gap: clamp(48px, 7vw, 96px);
}

.project-specification {
  display: grid;
  min-height: 54px;
  padding: 0;
  border-top: 1px solid rgba(28, 28, 28, 0.13);
  align-items: center;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
}

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

.project-specification dt {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-specification dd {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-continuation {
  padding: 30px;
}

.project-continuation__frame {
  position: relative;
  height: calc(100svh - 60px);
  min-height: 36rem;
  overflow: hidden;
  border-radius: var(--header-radius);
  background: var(--near-black);
}

.project-continuation img,
.project-continuation video,
.project-continuation iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.project-continuation p {
  position: absolute;
  right: 30px;
  bottom: 28px;
  left: 30px;
  display: flex;
  justify-content: space-between;
  margin: 0;
  color: var(--white);
  font-size: 0.75rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .project-hero__copy {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project-hero__lead {
    max-width: 34rem;
  }

  .design-story__text {
    font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  }
}

@media (max-width: 639px) {
  .project-lightbox__figure {
    padding: 62px 16px 84px;
    gap: 14px;
  }

  .project-lightbox__figure img {
    max-height: calc(100dvh - 164px);
  }

  .project-lightbox__figure figcaption {
    font-size: 0.65rem;
  }

  .project-lightbox__figure figcaption span:first-child {
    max-width: calc(100vw - 94px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-lightbox__close {
    top: 14px;
    right: 14px;
  }

  .project-lightbox__arrow {
    top: auto;
    bottom: 18px;
    transform: none;
  }

  .project-lightbox__arrow--previous {
    left: calc(50% - 50px);
  }

  .project-lightbox__arrow--next {
    right: calc(50% - 50px);
  }

  .project-nav-shell {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .project-nav-shell.is-menu-open {
    height: calc(100svh - 32px);
  }

  .project-header {
    padding: 20px;
  }

  .project-hero__copy {
    padding: 90px 20px 24px;
  }

  .project-menu {
    right: 20px;
    bottom: 24px;
    left: 20px;
    overflow-y: auto;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-menu nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1.25rem;
  }

  .project-menu__context {
    padding: 20px 0 0;
    border-top: 1px solid rgba(33, 33, 33, 0.14);
    border-left: 0;
  }

  .design-story {
    min-height: calc(var(--story-count, 3) * 120svh);
  }

  .design-story__sticky {
    top: 186px;
    height: calc(100svh - 186px);
    min-height: 32rem;
    padding: 61px 20px 28px;
  }

  .design-story__progress {
    width: calc(100% - 40px);
  }

  .design-story__grid {
    align-content: stretch;
    grid-template-rows: 2.5rem minmax(0, 1fr);
    gap: 24px;
  }

  .design-story__titles {
    height: 2.5rem;
    padding: 0;
  }

  .design-story__title-stack {
    top: 0;
  }

  .design-story__title {
    font-size: 1.125rem;
  }

  .design-story__copy {
    min-height: 24rem;
  }

  .design-story__text {
    top: 0;
    font-size: clamp(1.45rem, 6.4vw, 2rem);
  }

  .design-story__text--long,
  .design-story__text--very-long {
    font-size: clamp(1.05rem, 4.7vw, 1.4rem);
    line-height: 1.12;
  }

  .project-gallery__slide {
    width: calc(100vw - 40px);
  }

  .project-gallery {
    height: 400svh;
    margin-top: 0;
  }

  .project-gallery--story-linked {
    height: 760svh;
    margin-top: -340svh;
  }

  .project-gallery__sticky {
    top: 186px;
    height: calc(100svh - 186px);
  }

  .project-specifications {
    padding: 104px 20px;
  }

  .project-specifications__grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    column-gap: 0;
  }

  .project-specification {
    min-height: 56px;
  }

  .project-specification:nth-child(3) {
    border-bottom: 0;
  }

  .project-continuation {
    padding: 16px;
  }

  .project-continuation__frame {
    height: calc(100svh - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-nav-shell,
  .project-menu__item,
  .design-story__title,
  .design-story__text,
  .story-word,
  .project-gallery__slide,
  .project-lightbox,
  .project-lightbox__figure img {
    transition: none;
  }
}
