@import url("https://fonts.googleapis.com/css2?family=Alegreya+Sans+SC:wght@400;500;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap");

* {
  box-sizing: border-box;
}

:root {
  --black: #0b0b0b;
  --white: #f7f7f4;
  --ink: #171717;
  --muted: #5e5e5a;
  --warm-line: rgba(243, 234, 215, 0.3);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  text-align: justify;
}

a {
  color: inherit;
}

.project-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 3vw, 46px);
  padding: 10px clamp(16px, 3vw, 38px);
  background: var(--white);
  font-family: "Alegreya Sans SC", "Poppins", Arial, Helvetica, sans-serif;
  font-size: 0.98rem;
  text-align: left;
}

.project-header a {
  border-bottom: 1px solid transparent;
  padding: 7px 0;
  text-decoration: none;
}

.project-header a:hover {
  border-bottom-color: currentColor;
}

.itch-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px !important;
  border: 1px solid var(--black);
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
  font-weight: 800;
  text-transform: uppercase;
}

.project-hero {
  background: var(--black);
  color: var(--white);
  padding: 46px 0 70px;
  text-align: center;
}

.project-hero h1 {
  margin: 0 0 42px;
  font-family: "Alegreya Sans SC", "Poppins", Arial, Helvetica, sans-serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.carousel {
  position: relative;
  --carousel-card-width: clamp(520px, 31vw, 690px);
  --carousel-gap: 20px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.media-strip {
  width: 100%;
  display: flex;
  gap: var(--carousel-gap);
  padding: 0 0 18px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  will-change: transform;
}

.media-strip::-webkit-scrollbar {
  display: none;
}

.media-strip.is-dragging {
  cursor: grabbing;
}

.media-strip.is-animating {
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-button {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 247, 244, 0.28);
  border-radius: 50%;
  background: rgba(11, 11, 11, 0.76);
  color: var(--white);
  cursor: pointer;
  transform: translateY(-50%);
}

.carousel-button:hover {
  background: rgba(247, 247, 244, 0.94);
  color: var(--black);
}

.carousel-button span {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
}

.carousel-button-prev {
  left: clamp(84px, 9vw, 150px);
}

.carousel-button-next {
  right: clamp(84px, 9vw, 150px);
}

.media-strip figure {
  flex: 0 0 var(--carousel-card-width);
  margin: 0;
}

.media-strip img,
.media-strip video {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  border-radius: 2px;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.project-cta {
  margin-top: 34px;
}

.project-cta a {
  min-width: 220px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--white);
  border-radius: 8px;
  color: var(--white);
  font-family: "Alegreya Sans SC", "Poppins", Arial, Helvetica, sans-serif;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.project-cta a:hover {
  background: var(--white);
  color: var(--black);
}

.home-button {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(11, 11, 11, 0.28);
  border-radius: 50%;
  background: rgba(247, 247, 244, 0.92);
  color: var(--black);
  box-shadow: 0 12px 30px rgba(11, 11, 11, 0.16);
}

.home-button:hover {
  background: var(--black);
  color: var(--white);
}

.home-button svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.project-body {
  width: min(1220px, calc(100% - 42px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: clamp(58px, 8vw, 120px);
  margin: 0 auto;
  padding: 92px 0 130px;
}

.project-copy {
  display: grid;
  gap: 58px;
  align-content: start;
}

.project-copy section {
  max-width: 720px;
}

.project-copy h2,
.process h2 {
  margin: 0 0 20px;
  font-family: "Alegreya Sans SC", "Poppins", Arial, Helvetica, sans-serif;
  font-size: clamp(1.65rem, 2vw, 2.2rem);
  font-weight: 500;
}

.project-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.72;
  text-align: justify;
}

.process {
  align-content: start;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.process-grid figure {
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(11, 11, 11, 0.1);
  border-radius: 8px;
  background: #fbfaf6;
  cursor: zoom-in;
  transform-origin: center;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.process-grid figure:hover {
  border-color: rgba(11, 11, 11, 0.24);
  box-shadow: 0 16px 34px rgba(11, 11, 11, 0.12);
  transform: scale(1.035);
}

.process-grid a {
  display: block;
}

.process-grid img {
  width: 100%;
  display: block;
  object-fit: contain;
}

.process-grid figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: left;
}

.wide-process {
  grid-column: 1 / -1;
}

.process-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 58px);
  background: rgba(11, 11, 11, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.process-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.process-lightbox-panel {
  width: min(1280px, 96vw);
  max-height: min(820px, 88vh);
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 58px);
  align-items: center;
  padding: clamp(20px, 3vw, 38px);
  border: 1px solid rgba(247, 247, 244, 0.18);
  border-radius: 8px;
  background: #f7f7f4;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  transform: scale(0.94);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.process-lightbox.is-open .process-lightbox-panel {
  transform: scale(1);
}

.process-lightbox-text {
  align-self: center;
}

.process-lightbox-text h3 {
  margin: 0 0 14px;
  font-family: "Alegreya Sans SC", "Poppins", Arial, Helvetica, sans-serif;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 500;
  text-align: left;
}

.process-lightbox-text p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
  text-align: justify;
}

.process-lightbox-image {
  width: 100%;
  height: min(680px, calc(82vh - 76px));
  max-width: 100%;
  max-height: 100%;
  display: block;
  justify-self: center;
  object-fit: contain;
}

.process-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 247, 244, 0.42);
  border-radius: 50%;
  background: rgba(11, 11, 11, 0.72);
  color: var(--white);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.process-lightbox-close:hover {
  background: var(--white);
  color: var(--black);
}

@media (max-width: 860px) {
  .project-header {
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
  }

  .project-hero {
    padding-top: 34px;
  }

  .carousel {
    --carousel-card-width: clamp(300px, 50vw, 500px);
    --carousel-gap: 18px;
    width: 100%;
  }

  .carousel-button {
    width: 40px;
    height: 40px;
  }

  .carousel-button-prev {
    left: 22px;
  }

  .carousel-button-next {
    right: 22px;
  }

  .project-body {
    grid-template-columns: 1fr;
    gap: 64px;
    padding-top: 70px;
  }

  .process-lightbox-panel {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .process-lightbox-text {
    order: 2;
  }

  .process-lightbox-image {
    order: 1;
    height: min(420px, 54vh);
    max-height: 54vh;
  }
}

@media (max-width: 560px) {
  .carousel {
    --carousel-card-width: 82vw;
    --carousel-gap: 14px;
    width: 100%;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }

  .home-button {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }
}
