
:root {
  --gap-l: 120px;
  --gap-s: 15px;
  --ff-sans: Arial, sans-serif;
  --color-bg: #ffffff;
  --color-fg: #333333;
  --color-muted: #b4b4b4;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  scrollbar-width: none;
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.5;
  background: var(--color-bg);
  color: var(--color-fg);
}

body.modal-open { overflow: hidden; }

.layout {
  display: flex;
  height: 100vh;
}

/* 3. Bio */
.sidebar {
  width:8%;
  height: 100vh;
  padding: var(--gap-s);
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-width: none;
}

.bio__item + .bio__item {
  margin-top: var(--gap-s);
}
.bio__item h1 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.bio__email {
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.bio__text {
  font-size: 0.9rem;
  color: var(--color-muted);
  white-space: pre-wrap;
}

/* 4. Gallery */
.gallery {
  width:92%;
  height: 100vh;
  align-content: space-around;
  align-items: center;
  gap: var(--gap-l);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  position: static;
  padding: 50px 100px 50px 100px;
  overflow-x: hidden;
  overflow-y: scroll;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.6s,cubic-bezier(0.25,0.1,0.25,1);
  background: url("assets/.gif") 
            center top/ contain
            repeat scroll;
}

.modal-open .gallery {
  width: 42%;
  gap: 40px;
  padding-left: 100px;
  padding-right: 100px;
  transform: scale(1);
}

.gallery__item {
  flex: 0 0 25%;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative; 
  transform-origin: center center;
  border: 12px solid #181818;
  border-bottom-width: 36px;
  transition: transform .4s ease;
}

.gallery__label {
  position: absolute;
  right: 0;
  bottom: -1.4vw;
  color: #cccccc;
  font-size: 12px;
  background: none;
  letter-spacing: -0.05em;
  font-family: 'Cutive Mono', 'Courier New', Courier, monospace;
}

.modal-open .gallery__label {
  bottom: -0.9vw;
  font-size: 8px;
}


.modal-open .gallery__item {
  flex: 0 0 25%;
  border-width: 8px 8px 24px 8px;
}

.gallery__item img {
  width: 100%;
  height: auto;
  object-fit: contain; 
  display: block;
  transition: 1s ease;
}

.gallery__item.landscape img {
  object-fit: cover;
}

.gallery__item.landscape {
  flex: 0 0 33%;
}

.gallery__item:hover img {
  filter: brightness(0.6) blur(1px); 
}

.gallery__title,
.gallery__desc,
.gallery__meta {
  position: absolute;
  left: 0.5vw;
  color: var(--color-bg);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; 
  text-align: left;
  margin: 0;
}

.gallery__title { 
  font-size: 1.2vw; 
}

.gallery__meta  { 
  top: 2vw; 
  font-size: 0.7vw; 
}

.gallery__desc { 
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  bottom: 0.5vw; 
  font-size: 0.7vw;
  right: 30%; 
}

.modal-open .gallery__title {
  font-size: 0.8vw;
  left: 0.2vw; 
}

.modal-open .gallery__meta {
  Top: auto;
  bottom: 0; 
  font-size: 0.6vw;
  left: 0.2vw;
}

.gallery__item:hover .gallery__title,
.gallery__item:hover .gallery__desc,
.gallery__item:hover .gallery__meta {
  opacity: 1;
}

.modal-open .gallery__item:hover .gallery__desc {
  display: none;
}

.back-to-top {
  flex: 0 0 100%;
  text-align: center; 
  position: static;
  bottom: 10px;
  left: 50%;
  color: var(--color-muted);
  background-color: transparent;
  border: transparent;
  cursor: pointer;
  z-index: 1000;
  transition: 0.3s ease;
}

.back-to-top::before {
  content: '⭯';
  display: inline-block;
  font-size: 36px;
}

.back-to-top:hover {
  color: var(--color-fg);
}

/* Detail Pages */
.modal {
  position: fixed;
  top: 0; right: 0;
  width: 50%; 
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transform: translateX(100%);
  box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.2);
}
.modal.active {
  pointer-events: all;
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1)
}

.modal__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  align-items: left;
  background: #ffffff;
  position: relative;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-width: none;
  scroll-behavior: smooth;
  z-index: 999;
}

.modal__close {
  position: absolute;
  top: 5px; right: 5px;
  align-self: unset;
  background: none;
  border: none;
  font-size: 36px;
  cursor: pointer;
  color: var(--color-muted);
  z-index: 9999;
}

.modal__close:hover {
  color: var(--color-fg);
}

.modal__inner img {
  max-width: 100%;
  align-items: center;
}

#modal-title {
  color: #000000;
  margin: 10px 0px 0px 30px;
  font-size: 30px;
  font-weight: 800;
  display: block;
}

#modal-meta {
  color: #000000;
  font-size: 15px;
  margin: 0px 0px 10px 30px;
  line-height: 20px;
  font-weight: 600;
  display: block;
}

.modal__brief {
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 0;  
}

#modal-desc {
  color: #111111;
  margin: auto 30px 30px 30px;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 36px;
}

#modal-desc-main {
  width: 50vw;
  font-size: 15px;
  font-weight: 400;
  display: block;
  white-space: pre-line;
}

#modal-desc-side {
  width: 50vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#modal-desc-side img {
  max-width: 100%;
  max-height: 500px;
  margin-bottom: 12px;
}

.desc-caption {
  color: #111111;
  font-size: 10px;
  text-align: right;
  margin-top: 4px;
}

/* scrollbar */
.gallery::-webkit-scrollbar{
  -webkit-appearance: none;
  width: 5px;
}

.gallery::-webkit-scrollbar-track {
  background: transparent;
}

.gallery::-webkit-scrollbar-thumb{
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.gallery::-webkit-scrollbar-thumb:hover{
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.active .modal__inner {
  animation: slideInRight 0.6s ease-out;
}

/* —— Carousel Container —— */
#modal-carousel, #drawings-carousel,#archives-carousel,#sites-carousel {
  width: 100%;
  height: 80vh;
  margin-top: 90px;
  flex-shrink: 0;
  display: block;
  position: relative;
  background: #ffffff;
}

#archives-carousel,#sites-carousel{
  margin-top: 0px;
  height: 45vh;
  background: #111111;
}

#archive-site {
  height: 99.5vh;
  background: #090909;
  display: flex;
  align-items: center;
  margin-bottom: 0.5vh;
}

#archive-site img {
  -webkit-user-drag: none;
  user-drag: none;
}

.archive-slider {
  will-change: scroll-position; 
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  overflow-x: scroll;
  overflow-y: hidden;
  cursor: grab;
  row-gap: 35px;
  column-gap: 20px;
  padding: 50px;
  scrollbar-width: none;
  scroll-behavior: auto;
  align-items: flex-start 
}

#archive-site .archive-slider .gallery__item:hover img {
  filter: none!important;
}

#archive-site .archive-slider .gallery__item {
  display: inline-grid !important;
  grid-template-columns: auto;
  grid-template-rows: auto auto auto;
  align-content:start;
  border: none!important;
  transition: none!important;
  position: relative!important;
  height: auto          !important;
  flex: none;
}

#archive-site .archive-slider .gallery__item img {
  grid-row: 1; grid-column: 1;
  display: block;
  align-content: center!important;
  max-width: 12vw!important;
  max-height: 28vh!important;
  width: auto          !important;
  height: auto          !important;
  object-fit: contain     !important;
  border-color: #cccccc!important;
  border-style:solid!important;
  border-width: 8px 8px 8px 8px!important;
  margin-bottom: 3px;
  transition: none!important;
  filter: grayscale(1);
}


#archive-site .archive-slider::before,
#archive-site .archive-slider::after {
  content: '';
  position: absolute;
  top: 100vh;
  width: 100px;
  height: 99.5vh;
  pointer-events: none;
  z-index: 999;
}

#archive-site .archive-slider::before {
  left: 0;
  background: linear-gradient(to right, #090909, transparent);
}

#archive-site .archive-slider::after {
  right: 0;
  background: linear-gradient(to left, #090909, transparent);
}

#archive-site .gallery__label,
#archive-site .archive__meta {
  white-space: normal !important;
  text-align:right;

  font-family: 'Cutive Mono', monospace;
  font-size: 9px; 
  line-height: 1.2;
  letter-spacing: -0.05em;
  color: #cccccc;
}

#archive-site .archive-slider .gallery__item .gallery__label {
  grid-row: 2; grid-column: 1;
  position: relative;
  bottom: 0px;
}

#archive-site .archive-slider .gallery__item .archive__meta {
  grid-row: 3; grid-column: 1;
  position: absolute;
  right: 0;
}

#archive-site .archive-slider .gallery__item .gallery__label:last-child {
  grid-row: 2; grid-column: 1;
}

#drawings-carousel {
  height: 80vh;
  margin-bottom: 60px;
}

.modal__inner::after {
  content: '';
  display: block;
  height: 150px;
  flex-shrink: 0;
}

.modal__carousel-inner {
  display: flex;
  align-items: center;
  transition: transform 0.4s ease;
  height: 100%;
}

.modal__carousel-item {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center; 
}
.modal__carousel-item img {
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: contain;
}

.modal__carousel-item img.landscape {
  width: auto;
  height: 66%;
  opacity: 1;
  object-fit: contain;
}

.modal__carousel-item img.portrait {
  height: 90%;
  width: auto;
  opacity: 1;
  object-fit: contain;
}

/* ◀▶*/
.modal__carousel-nav {
  position: absolute;
  top: 50%; left: 0;
  width: 100%; height: 90%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 999;
}
.modal__carousel-nav button {
  position: absolute;
  top: 50%; 
  transform: translateY(-50%);
  width: 50%; height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: all;
  display: flex;
  align-items: center;
  color: hsla(0, 0%, 50%, 1);
  font-size: 3vh;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.modal__carousel-nav button:hover {
  opacity: 1;
}

.modal__carousel-nav .prev { left: 0; }
.modal__carousel-nav .next { right: 0; justify-content: end;}

/* indicators */
.modal__carousel-indicators {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap:3px
}
.modal__carousel-indicators button {
  width: 40px;
  height: 4px;
  padding-top: 4px;
  border: none;
  background: hsl(0, 0%, 50%, 0.3);
  box-sizing: content-box;
  background-clip: content-box;
  cursor: pointer;
}
.modal__carousel-indicators button.active {
  background: hsl(0, 0%, 50%, 0.5);
}

#archive-site,
#archive-site * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none; 
}

/* phone */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .gallery {
    width: 100vw;
    overflow-y: auto;
    overflow-x: hidden;
    flex-direction: row;
    padding: 5vw;
    gap: 30px;
  }
  .gallery__item {
    flex: 0 0 40%;
    max-width: 100vw;
    transform: none !important;
  }

  .gallery__item.landscape {
    flex: 0 0 50%;
  }
}
@media (max-width: 900px) {
  .modal {
    width: 100vw;
    right: 0;
    border-radius: 0;
    min-width: unset;
  }

  .modal-open .gallery {
    display: none
  }

  .modal__inner {
    font-size: 1.1em;
  }
  #modal-meta {
    font-size: 3vw;
    margin: 1vw  
  }

  #modal-title {
    font-size: 6vw;
    margin: 1vw  
  }
  
  #modal-desc{
    font-size: 3vw;
    margin: 1vw;
    margin-top: 10vw  
  }
    
  .modal__close {
    font-size: 8vw;
    top: 1vw;
    right: 1vw;
  }

  #modal-carousel, #drawings-carousel {
  margin-top: 6vw;
  }
}
@media (max-width: 900px) {
  #modal-desc {
    flex-direction: column;
    gap: 16px;
  }
  #modal-desc-side {
    align-items: flex-start;
    max-width: 100vw;
  }
  #modal-desc-side img {
    max-width: 80vw;
    height: auto;
  }
}