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

:root {
  --bg: #bdbdb6;
  --ink: #1c1c1a;
  --mute: rgba(28, 28, 26, 0.48);
  --soft: rgba(28, 28, 26, 0.72);
  --pad: max(1.25rem, 3.5vw);
  --nav-h: 3.25rem;
  --ease: cubic-bezier(0.33, 0, 0.2, 1);
}

html {
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100dvh;
  font: 400 1rem/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: -0.015em;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

canvas {
  display: block;
  max-width: none;
}

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

::selection {
  background: var(--ink);
  color: var(--bg);
}

:focus-visible {
  outline: none;
  opacity: 0.72;
}

.wrap {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-h) + 1.5rem);
}

body.home {
  overflow: hidden;
  height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

body.home .wrap {
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
}

.nav {
  position: fixed;
  z-index: 40;
  left: var(--pad);
  bottom: var(--pad);
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-start;
  align-items: baseline;
  gap: 1rem 1.35rem;
  max-width: calc(100% - var(--pad) * 2);
  padding: 0.65rem 0.8rem;
  background: var(--bg);
}

.nav a,
.nav span {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: var(--mute);
  transition: color 0.3s var(--ease);
}

.nav a:hover {
  color: var(--ink);
}

.nav span[aria-current="page"] {
  color: var(--ink);
  cursor: default;
  pointer-events: none;
}

.stage {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.copy {
  position: absolute;
  z-index: 3;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  width: min(18rem, 28vw);
  display: grid;
  gap: 1.1rem;
  pointer-events: none;
}

.copy a {
  pointer-events: auto;
}

@media (max-width: 900px) {
  .copy {
    left: var(--pad);
    right: auto;
    top: auto;
    bottom: calc(var(--nav-h) + 2rem);
    transform: none;
    width: min(18rem, calc(100% - var(--pad) * 2));
  }
}

h1 {
  font-size: clamp(2rem, 1.2rem + 3vw, 3.2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: lowercase;
}

body.home h1 {
  text-transform: none;
}

.lede {
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--soft);
  max-width: 24ch;
}

.link {
  position: relative;
  display: inline-block;
  width: fit-content;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  padding-bottom: 0.2rem;
  color: var(--ink);
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--ink) 18%,
    var(--ink) 82%,
    transparent 100%
  );
  opacity: 0;
  transform: scaleX(0.92);
  transform-origin: center;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.link:hover::after {
  opacity: 0.85;
}

.hero {
  position: relative;
  width: 100%;
  height: clamp(10rem, 24vh, 14rem);
  overflow: hidden;
  background: var(--bg);
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.hero canvas.on {
  opacity: 1;
}

.hero h1 {
  position: absolute;
  left: var(--pad);
  bottom: 1.1rem;
  z-index: 2;
  font-size: clamp(2.2rem, 1.2rem + 3.5vw, 3.6rem);
  pointer-events: none;
}

.main {
  flex: 1;
  padding: 2.75rem var(--pad) 4rem;
}

.main > .prose {
  max-width: 42rem;
  display: grid;
  gap: 1rem;
}

.main p {
  font-weight: 300;
  color: var(--soft);
  line-height: 1.7;
}

.list {
  max-width: 42rem;
  display: grid;
  gap: 2.5rem;
}

.list h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.list p {
  font-weight: 300;
  color: var(--soft);
  line-height: 1.7;
  max-width: 38rem;
}

.subnav {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.35rem;
  padding: 0.8rem var(--pad);
  background: var(--bg);
}

body.work-page .wrap {
  width: 100%;
  min-width: 0;
}

.subnav a,
.subnav span {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--mute);
}

.subnav a:hover,
.subnav span[aria-current="page"] {
  color: var(--ink);
}

.work-main {
  position: relative;
  z-index: 1;
  width: calc(100vw - var(--pad) * 2);
  min-width: 0;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 0 8rem;
}

.project {
  min-width: 0;
  padding: clamp(3rem, 5vw, 4.5rem) 0;
}

.project-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.project-name {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 1.8vw, 1.5rem);
  min-width: 0;
}

.project-logo {
  flex: 0 0 auto;
  display: block;
  width: auto;
  height: auto;
  max-width: 5rem;
  max-height: 5rem;
  object-fit: contain;
}

.project-logo-bijio,
.project-logo-staamps,
.project-logo-pinsift {
  width: clamp(2.8rem, 5vw, 4.5rem);
}

.project-logo-tuff {
  width: clamp(4rem, 7vw, 6rem);
  max-width: 6rem;
}

.project h2 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.live-link,
.carousel-controls {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.live-link {
  flex: 0 0 auto;
  color: var(--soft);
}

.live-link:hover {
  color: var(--ink);
}

.project-cover {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.project-cover-bijio {
  max-width: min(100%, 56rem);
}

.project-cover-tuff {
  max-width: min(100%, 54rem);
}

.project-cover img,
.image-row img,
.card-row img,
.carousel-slide img,
.qualta-gallery img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.project-text {
  display: grid;
  gap: 1.2rem;
  max-width: 44rem;
  margin: clamp(2rem, 3.5vw, 3rem) auto;
}

.project-text p {
  color: var(--soft);
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  font-weight: 300;
  line-height: 1.75;
}

.project-text-compact {
  margin-bottom: 0;
}

.image-row {
  align-items: start;
  justify-content: center;
  gap: clamp(1rem, 2vw, 2rem);
  margin: 0 auto;
}

.image-row-bijio {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 29rem));
  max-width: 60rem;
}

.image-row-portrait {
  display: flex;
  max-width: 56rem;
}

.image-row-bijio figure {
  display: flex;
  justify-content: center;
}

.image-row-bijio img {
  width: auto;
  height: clamp(16rem, 28vw, 26rem);
}

.image-row-portrait figure {
  flex: 0 1 auto;
}

.image-row-portrait img {
  width: auto;
  max-width: none;
  height: clamp(20rem, 30vw, 28rem);
}

.card-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.6rem, 1.5vw, 1.25rem);
  max-width: 54rem;
  margin: 0 auto;
}

.card-row img {
  width: 100%;
}

.carousel {
  max-width: 52rem;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
}

.carousel-viewport {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.carousel-viewport::-webkit-scrollbar,
.card-row::-webkit-scrollbar,
.image-row::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.carousel-slide img {
  max-width: 100%;
}

.carousel-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  color: var(--mute);
  padding-top: 0.8rem;
}

.carousel-controls button {
  width: fit-content;
  font: inherit;
  color: var(--soft);
  letter-spacing: inherit;
  text-transform: inherit;
  background: transparent;
  cursor: pointer;
}

.carousel-controls button:last-child {
  justify-self: end;
}

.carousel-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

.about-main {
  position: relative;
  z-index: 1;
  width: calc(100vw - var(--pad) * 2);
  min-width: 0;
  max-width: 66rem;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) 0 8rem;
}

.about-name {
  margin-bottom: clamp(4rem, 8vw, 7rem);
}

.about-name h2 {
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.about-name p {
  max-width: 32rem;
  margin-top: 1.5rem;
  color: var(--soft);
  font-weight: 300;
}

.about-section {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: clamp(2rem, 7vw, 6rem);
  margin-top: clamp(3.5rem, 7vw, 6rem);
}

.about-section h3,
.education-list h4 {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.about-section > p,
.education-list p {
  color: var(--soft);
  font-weight: 300;
  line-height: 1.75;
}

.education-list {
  display: grid;
  gap: 2.5rem;
}

.education-list h4 {
  margin-bottom: 0.6rem;
}

.project-cover img,
.image-row img,
.card-row img,
.carousel-slide img,
.qualta-gallery img {
  cursor: zoom-in;
}

.qualta-gallery {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  max-width: 52rem;
  margin: 3rem auto 0;
}

.qualta-primary img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.qualta-secondary {
  display: flex;
  align-items: start;
  justify-content: center;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.qualta-secondary img {
  display: block;
  width: auto;
  max-width: none;
  height: clamp(7rem, 12vw, 9.5rem);
}

.image-lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 2rem;
  background: rgba(28, 28, 26, 0.94);
}

.image-lightbox[open] {
  display: grid;
  place-items: center;
}

.image-lightbox::backdrop {
  background: transparent;
}

.image-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 4rem);
  max-height: calc(100dvh - 4rem);
}

.image-lightbox button {
  position: fixed;
  z-index: 2;
  top: 1rem;
  right: 1rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  cursor: pointer;
}

@media (max-width: 700px) {
  .project-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-row-bijio,
  .image-row-portrait,
  .card-row,
  .qualta-secondary {
    display: flex;
    justify-content: flex-start;
    width: calc(100% + var(--pad));
    overflow-x: auto;
    padding-right: var(--pad);
    scroll-snap-type: x mandatory;
  }

  .image-row-bijio figure {
    flex: 0 0 auto;
  }

  .image-row-portrait figure {
    flex: 0 0 auto;
  }

  .card-row figure {
    flex: 0 0 10rem;
  }

  .image-row figure,
  .card-row figure,
  .qualta-secondary figure {
    scroll-snap-align: start;
  }

  .image-row-bijio img {
    width: auto;
    max-width: none;
    height: 68vw;
  }

  .image-row-portrait img {
    height: min(60vh, 28rem);
  }

  .qualta-secondary img {
    height: 28vw;
  }

  .image-lightbox {
    padding: 1rem;
  }

  .image-lightbox img {
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 2rem);
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .about-name h2 {
    overflow-wrap: anywhere;
  }
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: out 0.35s var(--ease) both;
}

::view-transition-new(root) {
  animation: in 0.35s var(--ease) both;
}

@keyframes out {
  to {
    opacity: 0;
  }
}

@keyframes in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }

  .hero canvas {
    opacity: 1;
    transition: none;
  }
}
