:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --ink: #242424;
  --muted: #8a867f;
  --line: rgba(36, 36, 36, 0.13);
  --wash: #efede8;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: Didot, "Bodoni 72", Georgia, "Times New Roman", serif;
  --sans: Avenir, "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --card-w: clamp(150px, 14.5vw, 210px);
  --card-aspect: 1.34;
  --card-scale: 1.55;
  --shift-1: clamp(26px, 4vw, 58px);
  --shift-2: clamp(10px, 1.5vw, 22px);
  --carousel-h: calc(var(--card-w) * var(--card-aspect) * var(--card-scale));
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.92), transparent 34rem),
    linear-gradient(180deg, #fff 0%, var(--paper) 62%, #f5f2ec 100%);
  font-family: var(--sans);
  letter-spacing: 0;
}

body.is-animating .app-shell {
  opacity: 0;
  transform: translateY(6px);
}

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

button {
  color: inherit;
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px clamp(22px, 4vw, 58px);
  pointer-events: none;
}

.brand,
.top-nav {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--serif);
  font-size: clamp(22px, 2vw, 31px);
  font-weight: 400;
  line-height: 1;
  text-transform: none;
}

.brand small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.top-nav {
  display: flex;
  gap: 22px;
  align-items: center;
  font-family: var(--serif);
  font-size: clamp(19px, 1.7vw, 28px);
  font-style: italic;
}

.top-nav a {
  color: rgba(32, 32, 32, 0.42);
  transition: color 260ms ease, transform 260ms var(--ease);
}

.top-nav a:hover,
.top-nav a.active {
  color: var(--ink);
  transform: translateY(-1px);
}

.app-shell {
  min-height: 100vh;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 240ms ease, transform 300ms var(--ease);
}

.home-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 128px 0 42px;
  overflow: hidden;
}

.category-switch {
  display: inline-flex;
  gap: 18px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-copy h1,
.project-hero h1,
.about-intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.98;
}

.project-hero p,
.about-intro p,
.about-body p {
  color: var(--muted);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.68;
}

.category-switch button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: 0 2px 10px;
  color: rgba(32, 32, 32, 0.44);
  cursor: pointer;
  font-family: var(--serif);
  font-size: clamp(19px, 1.6vw, 26px);
  font-style: italic;
  transition: color 220ms ease, border-color 220ms ease;
}

.category-switch button.active,
.category-switch button:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.carousel-wrap {
  position: relative;
  align-self: center;
  padding: 4.5vh 0 5.4vh;
}

.carousel {
  display: flex;
  align-items: center;
  gap: clamp(1.6rem, 3.6vw, 3.4rem);
  height: calc(var(--carousel-h) + 1.8rem);
  padding: 0 calc(50% - var(--card-w) / 2);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.carousel__card {
  position: relative;
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  scroll-snap-align: center;
  cursor: pointer;
  opacity: 0.42;
  transform-origin: center center;
  transition:
    transform 560ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 420ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 420ms ease;
  z-index: 1;
}

.carousel__card.is-active {
  opacity: 1;
  transform: scale(var(--card-scale)) translateY(-5px);
  filter: saturate(1);
  z-index: 10;
}

.carousel__card.is-prev {
  opacity: 0.68;
  transform: translateX(calc(var(--shift-1) * -1));
  filter: saturate(0.86);
  z-index: 4;
}

.carousel__card.is-next {
  opacity: 0.68;
  transform: translateX(var(--shift-1));
  filter: saturate(0.86);
  z-index: 4;
}

.carousel__card.is-prev-2 {
  opacity: 0.46;
  transform: translateX(calc(var(--shift-2) * -1));
  filter: saturate(0.78);
  z-index: 3;
}

.carousel__card.is-next-2 {
  opacity: 0.46;
  transform: translateX(var(--shift-2));
  filter: saturate(0.78);
  z-index: 3;
}

.carousel__card:hover:not(.is-active) {
  opacity: 0.9;
}

.carousel__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5.36;
  margin: 0;
  overflow: hidden;
  background: var(--wash);
}

.carousel__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.015);
  transition: transform 520ms var(--ease);
}

.carousel__card.is-active img,
.carousel__card:hover img {
  transform: scale(1.055);
}

.carousel__no {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  min-width: 34px;
  background: transparent;
  padding: 0;
  color: #fff;
  font-family: var(--serif);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.carousel__hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.18) 48%, transparent 74%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.carousel__card:hover .carousel__hover,
.carousel__card.is-active .carousel__hover {
  opacity: 1;
}

.carousel__hover h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(16px, 1.3vw, 21px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.12;
}

.carousel__hover p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.project-view,
.about-view {
  padding: 118px clamp(22px, 4.2vw, 64px) 96px;
}

.project-hero {
  display: block;
  width: min(760px, 100%);
  margin: 0 auto clamp(60px, 7vw, 110px);
  text-align: center;
}

.project-hero .eyebrow {
  margin-bottom: 24px;
}

.project-hero h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 2.25vw, 36px);
  font-weight: 400;
  letter-spacing: 0;
}

.project-hero p {
  max-width: 560px;
  margin: 18px auto 0;
  color: #7f8788;
  font-family: var(--sans);
  font-size: clamp(14px, 1.18vw, 19px);
  font-weight: 400;
  line-height: 1.55;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(54px, 6vw, 96px) clamp(42px, 7vw, 116px);
  width: min(1320px, 100%);
  margin: 0 auto;
}

.image-item {
  margin: 0;
}

.image-item .image-wrap {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--wash);
}

.image-item img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: saturate(0.94);
  transform: translateY(0);
  transition: transform 360ms var(--ease), filter 300ms ease;
}

.image-item.is-landscape .image-wrap {
  display: block;
  aspect-ratio: auto;
  background: transparent;
}

.image-item.is-landscape img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.image-item:hover img {
  filter: saturate(1.04);
  transform: translateY(-6px);
}

.image-item figcaption {
  min-height: 1.4em;
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.45;
  opacity: 0.72;
  transform: translateY(4px);
  transition: opacity 260ms ease, transform 320ms var(--ease);
}

.image-item:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

.about-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(20px, 3vw, 42px);
  text-align: center;
}

.about-intro {
  width: min(760px, 100%);
  padding-top: 0;
}

.about-intro h1 {
  font-size: clamp(36px, 3.7vw, 62px);
}

.about-portrait {
  margin: 0;
  width: min(14vw, 210px);
  min-width: 132px;
}

.about-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 0.72;
  object-fit: cover;
  background: var(--wash);
  filter: saturate(0.9);
}

.about-body {
  width: min(640px, 100%);
  padding-bottom: 8vh;
}

.about-body p {
  max-width: 620px;
  margin: 0 auto 20px;
  color: #555;
  font-family: var(--sans);
  font-size: clamp(16px, 1.25vw, 21px);
  font-weight: 300;
  line-height: 1.64;
}

.contact-list {
  display: grid;
  gap: 8px;
  margin-top: 26px;
  justify-items: center;
}

.contact-list a,
.contact-list span {
  width: fit-content;
  color: var(--ink);
  border-bottom: 1px solid rgba(32, 32, 32, 0.4);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
}

.empty-state,
.error-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .site-header {
    padding: 22px 18px;
  }

  .top-nav {
    font-size: 22px;
    gap: 14px;
  }

  .brand {
    font-size: 24px;
  }

  .brand small {
    max-width: 140px;
    line-height: 1.25;
  }

  .home-view {
    padding-top: 112px;
  }

  .project-hero {
    display: block;
    margin-bottom: 48px;
  }

  .project-hero .eyebrow {
    margin-bottom: 14px;
  }

  .project-hero p {
    margin-top: 16px;
  }

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

  .image-item:nth-child(n) {
    margin-top: 0;
  }

  .image-item img {
    width: 100%;
    height: 100%;
  }

  .about-view {
    padding-top: 122px;
  }

  .about-intro,
  .about-body {
    padding: 0;
  }

  .about-portrait {
    width: min(76vw, 360px);
    margin: 42px auto;
  }
}
