@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&display=swap");

:root{
  --sans: Helvetica, Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", sans-serif;
}

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

/* Main navigation */
#nav{
  background-color: rgb(255, 255, 255);
  position: sticky;
  top: 0;
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 24px;
  font-size: 16px;
  font-family: "Noto Sans Mono", monospace; /* 'Courier Prime', monospace; */
  margin-bottom: 10px;
}

/* Leah Jiaxin Yu */
#nav .name{
  color: darkgrey;
  text-decoration: none;
  white-space: nowrap;
}

#navList{
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#social-icons{
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#nav a{
  color: darkgrey;
  text-decoration: none;
}
#nav a:hover{
  color: black;
}

#social-icons img{
  height: 20px;
  width: auto;
}
#social-icons img:hover{
  opacity: .5;
}


/* on smaller screen */
@media (max-width: 700px){
  #nav{ padding: 10px 14px;
        flex-wrap: wrap; 
        gap: 10px; 
  }
  #navList{
    margin-top: 6px;
    width: 100%;
    justify-content: flex-end;
    gap: 14px;
  }

  #social-icons{ gap: 12px; }
}


/* Hero Video */
.hero{
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero iframe{
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vh;
  transform: translate(-50%, -50%);
  pointer-events: none;
}


/* WORKS grid */
.picContainer{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 24px;
}

/* each card */
.picContainer .card{
  display: block;
  text-decoration: none;
}

/* fixed 16:9 frame (prevents vertical video from stretching rows) */
.picContainer .media{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0px; 
}

/* make img/video fill the frame */
.picContainer .media > img,
.picContainer .media > video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* hover zoom (optional) */
.picContainer .card:hover .media > img,
.picContainer .card:hover .media > video{
  transform: scale(1.02);
  transition: transform .25s ease;
}

.media{ position: relative; overflow: hidden; aspect-ratio: 16/9; }

.media > video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;          /* video in the layer below */
}

.media > img.poster{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;          /* poster on the layer above */
  opacity: 1;
  transition: opacity .2s ease;
}

.media.is-playing > img.poster{
  opacity: 0;          /* hover, when play hide the img.poster */
  pointer-events: none;
}


/* responsive design: smaller screen, less row */
/* Laptop screen：4 -> 3 */
@media (max-width: 1100px){
  .picContainer{ grid-template-columns: repeat(3, 1fr); }
}

/* Ipad Screen：3 -> 2 */
@media (max-width: 900px){
  .picContainer{ grid-template-columns: repeat(2, 1fr); }
}

/* phone screen：2 -> 1 */
@media (max-width: 640px){
  .picContainer{
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 22px; /* gap btwn each project */
  }
}

footer {
  color: darkgrey;
  font-family: "Noto Sans Mono", monospace;
  text-align: center;
  font-size: 10px;
  padding: 10px;
}