@font-face {
    font-family: hatton;
    src: url(PPHatton-Medium.otf);
}
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #222;
}

.sharp{
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

a{
  color: #fff;
  text-decoration:underline;
}
a:hover{
  text-decoration:none;
}

#grid {
  position: absolute;
  top: 0%;
  left: 0;
  width: 100%;
  height: 90%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}
.cell {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1.5em;
  user-select: none;
  overflow: hidden;
  padding: 5px;
  font-family: hatton;
  border: 2px solid #222;
  cursor: pointer;
}

.image{
  position: absolute;
  width:100%;
  height:100%;
  background-position: center center;
  background-repeat: no-repeat;
  background-size:3000px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align:center;
  font-size: 10vmax;
  line-height:0.8;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  filter: brightness(0.5) saturate(0);
  z-index: 5;
  transition: filter 0.25s ease, opacity 0.5s ease;
}
.cell:hover > .image{
  filter: brightness(1) saturate(1);
  transition: filter 0.25s ease;
}

.maintitle {
  position: absolute;
  width:100%;
  height:100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align:center;
  font-size: 9vmax;
  line-height:0.8;
  text-shadow: 0 0 50px rgba(144, 144, 144, 0.3);
  z-index: 6;
  transition: opacity 0.5s ease;
}

@media only screen and (max-width: 900px) {
  .maintitle{
    font-size: 8vmax;
  }
}

.project-title {
  font-size: 9vmax;
  line-height:0.8;
  text-align: center;
}

/* Ensure text content sits above background images */
.cell .text {
  position: relative;
  z-index: 3;
}

.image.project {
  z-index: 1;
}

.project-title {
  position: relative;
  z-index: 4;
}

.project{
  background-size: contain;
  filter:saturate(1);
  image-rendering: auto;
  -ms-interpolation-mode: auto;
}

video{
  object-fit: contain;
  width:100%;
  height:100%;
}

.text {
  min-width: 20em;
  max-width: 40em;
  box-sizing: border-box;
  padding: 1em;
  hyphens:auto;
}

.course{
  font-size: 0.75em;
}

.nav{
  position: absolute;
  bottom: 0;
  left:0;
  right:0;
  margin:auto;
  z-index:100;
  color: #fff;
  background-color:rgba(51, 51, 51,0.8);
  font-family: hatton;
  width: 30vw;
  padding:5px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align:center;
  font-size: 1.5vmax;
}

.title{
  position:absolute;
  width:100%;
  height:100%;
  inset:0;
  color: #272727;
  font-size:24vw;
  line-height:0.5;
}

#header{
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10%;
  font-family: hatton;
  font-size: 2.5vmax;
  color: #ccc;
  letter-spacing: -0.1em;
  display: flex;
  align-items: center;
  justify-content: right;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  user-select: none;
  z-index:99999;
}
#header-s1{
  width:50%;
  display: flex;
  align-items: center;
  justify-content: left;
  font-size: 1.25vmax;
  letter-spacing: 0em;
  display: block;
}
#header-s2{
  width:50%;
  display: flex;
  align-items: center;
  justify-content: right;
}
#header-s2>span:hover{
  color: #fff;
  cursor: pointer;
}
@media only screen and (max-width: 900px) {
  #header{
    font-size: 4vmax;
  }
}

/* Lightbox / fullscreen styles for a cell when toggled */
/* The element with view-transition-name should be the .image inside the cell */
.overlay { pointer-events: none; position: fixed; inset: 0; z-index: 10000; }

body.lightbox-open {
  overflow: hidden; /* keep the page from scrolling while lightbox is open */
}

body.lightbox-open .overlay {
  pointer-events: auto;
}
/* also allow the overlay to receive pointer events when a project (not fullscreen)
   is open so the close button inside the overlay can be clicked without clicks
   falling through to the grid underneath. */
/* Note: keep the overlay non-interactive by default so clicks fall through
  to the grid. Interactive controls (close/prev/next) are appended to the
  document body so they can receive pointer events even when the overlay
  itself remains pointer-events:none. */

/* backdrop should sit under the fullscreen cell so the cell can receive clicks */
body.lightbox-open .overlay .backdrop {
  /* use the same background color as the page */
  background: rgba(34, 34, 34,0);
  position: absolute;
  inset: 0;
  z-index: 10000; /* below the .cell.lightbox-target (10001) */
}

/* When a specific cell has .lightbox-target, make its .image become fixed and fullbleed */
.cell.lightbox-target {
  z-index: 10000; /* above everything */
}

/* Make the entire cell become fixed/fullscreen when targeted. This is
   simpler and ensures the whole cell (image, title, text) is animated. */
body.lightbox-open .cell.lightbox-target {
  /* give a 10% margin around the enlarged cell */
  position: fixed;
  left:10%;
  right: 10%;
  bottom: 15%;
  top: 5%;
  /* width/height defined by inset, keep contents centered */
  width: auto;
  height: auto;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  cursor: zoom-out;
  box-sizing: border-box;
}

/* Ensure contents (image, video) inside the cell fill the area while
   keeping their aspect via object-fit / background-size. */
body.lightbox-open .cell.lightbox-target .image,
body.lightbox-open .cell.lightbox-target .image.project,
body.lightbox-open .cell.lightbox-target video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-size: contain;
}

/* Hide other project UI behind the fullscreen target while open */
body.lightbox-open .cell:not(.lightbox-target) { opacity: 0.0; pointer-events: none; }

/* Optional styling for snapshot smoothing during the view transition (if supported) */
::view-transition-old(root) .cell .image,
::view-transition-new(root) .cell .image {
  border-radius: 4px;
}

/* arrows for lightbox navigation */
.lightbox-arrow{
  position: fixed;
  top: 45%;
  transform: translateY(-50%);
  width: auto;
  height: auto;
  border: none;
  background: transparent; /* no circle behind the svg */
  padding: 8px;
  display: grid;
  place-items: center;
  z-index: 10002;
  cursor: pointer;
  /* hidden by default; shown only when lightbox is open */
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.lightbox-prev{ left: 2.5%; }
.lightbox-next{ right: 2.5%; }

/* show arrows only when lightbox is active */
body.lightbox-open .lightbox-arrow{
  /* visible but semi-transparent by default; JS will increase opacity on proximity */
  opacity: 0.25;
  pointer-events: auto;
}

/* icon sizing inside the button */
.lightbox-arrow-icon{
  width: 36px;
  height: 36px;
  display: block;
}

/* close button (top-right) */
.lightbox-close{
  position: fixed;
  top: 2.5%;
  right: 2.5%;
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  padding: 8px;
  z-index: 10003;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.lightbox-close-icon{
  width: 36px;
  height: 36px;
  display: block;
}

body.lightbox-open .lightbox-close,
body.project-open .lightbox-close{
  /* visible but semi-transparent by default; JS will increase opacity on proximity */
  opacity: 0.5;
  pointer-events: auto;
}

/* Slow down the shared-element view transition. Browsers that support
   the View Transitions API will use these snapshot pseudo-elements to
   control the animation timing. If unsupported, these rules are ignored. */
::view-transition-old(root) .cell,
::view-transition-new(root) .cell {
  transition-property: transform, opacity;
  transition-duration: 600ms;
  transition-timing-function: cubic-bezier(0.22, 0.0, 0.0, 1.0);
}

::view-transition-old(root) .cell .image,
::view-transition-new(root) .cell .image {
  transition-property: transform, opacity, border-radius;
  transition-duration: 600ms;
  transition-timing-function: cubic-bezier(0.22, 0.0, 0.0, 1.0);
}