/* -- Global -- */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

body {
  margin: 0px;
  font-family: "GT America", Arial, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: var(--font-light);
  transition: 0.5s ease-out;
  min-height: 100%;
}

ul,
li,
ol,
figure,
h1,
h2,
h3,
p {
  padding: 0px;
  margin: 0px;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
p,
li {
  font-size: var(--font-size-base);
  line-height: 0.95rem;
}

h1,
h2,
h3,
h4 {
  font-weight: var(--font-medium);
}

li {
  padding: 0px;
  margin: 0px;
  list-style: none;
}

a,
a:visited,
a:hover {
  color: var(--color-text);
  text-decoration: none;
}

/* -- Main structure -- */
#wrapper,
main {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 100%;
  overflow-x: hidden;
}

#wrapper {
  min-height: 100%;
}

main {
  /* position: absolute; */
  padding-top: 30px;
  flex: 1 0 auto;
}

/* -- Transitions -- */
.hide-scrollbar::-webkit-scrollbar {
  /* Hide scrollbar globally when .hide-scrollbar is on body */
  display: none !important;
  -webkit-appearance: none;
  width: 0;
  height: 0;
}

body {
  overflow: auto;
}

body nav,
body main {
  opacity: 1;
  transition: opacity 0.4s ease, background-color 0.5s ease-out,
    color 0.5s ease-out;
}

/* -- Low Power Mode tweaks (iOS/macOS specific)-- */
#LPM-test-video {
  /* opacity: 0; */
  pointer-events: none;
  width: 2px;
  position: absolute;
  top: 0px;
  left: 0px;
}

/* -- Navigation -- */
nav {
  position: fixed;
  top: 0px;
  width: 100%;
  background-color: var(--color-background);
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 30px;
  padding: 0px var(--padding-base);
  /* transition: background-color 0.5s ease-out, color 0.5s ease-out; */
  z-index: 9;
}

nav > * {
  margin: 0px;
  font-weight: var(--font-medium);
}

/* -- Intro -- */
#intro {
  display: block;
  padding: 0px;
  padding-bottom: var(--padding-base);
}

.hero-video-wrapper {
  /* aspect-ratio: 16 / 8; */
  height: 70vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-control--toggle-play {
  display: none;
  position: absolute;
  left: calc(50% - 11px);
  top: calc(50% - 11px);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 22px;
  padding: 3px;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  color: white;
  font-size: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.video-control--toggle-play.display {
  display: flex;
}

#intro h2 {
  padding: var(--padding-base);
  font-weight: var(--font-light);
}

/* -- Info -- */

#info {
  max-width: 600px;
  padding: var(--padding-base);
}

#description {
  margin-bottom: var(--padding-base);
}

#clients h3 {
  margin-bottom: var(--padding-base);
}

#contact li {
  margin-bottom: var(--padding-base);
}

#email {
  text-decoration: underline;
}

#dev-credits {
  display: block;
  margin-top: 15px;
}

#dev-credits span {
  opacity: 0.6;
}

/* -- Project's Grid -- */

ul.projects {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: calc(100vw + 1px);
  padding: 0px;
  padding-bottom: 30px;
  gap: 0px;
  list-style: none;
}

.project-wrapper {
  display: contents; /* This makes children act as direct children of parent grid */
}

.project-item {
  list-style: none;
  transition: 0.5s ease-in-out;
  position: relative;
  width: calc(100%);
  padding-bottom: 125%; /* replaces aspect ratio #1 */
}

.project-item {
  position: relative;
}

.project-item a {
  position: absolute;
  top: 0px;
  left: 0px;
  height: 100%;
  width: 100%;
  padding: 19%;
}

.projects img,
.projects video {
  opacity: 0;
  transition: 0.5s;
}

.projects video.entered, .projects img.entered  {
  opacity: 1;
}

 .projects img.entered  {
  max-width: 100%;
}

.projects img.portrait {
  max-height: 100%;
}

.projects img.landscape {
  width: 100%;
}

.projects video.ratio-4x5 {
  aspect-ratio: 4/5;
   width: 100%;
}

.projects video.ratio-16x9 {
  aspect-ratio: 16/9;
   width: 100%;
}

.projects video.ratio-9x16 {
  aspect-ratio: 9/16;
  height: 100%;
}

.projects video.ratio-1x1 {
  aspect-ratio: 1/1;
  width: 100%;
}

.group-hover video.entered {
  opacity: 1;
}

.project-item_label {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 15%;
  display: grid;
  grid-template-columns: 19% 1fr;
  padding: var(--padding-base) 0px;
}

.media-number,
.client-name {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  font-size: clamp(0.5rem, 0.9vw, var(--font-size-base));
  line-height: 1vw;
}

.media-number {
  padding-left: var(--padding-base);
}

.group-hover .client-name,
.group-hover .media-number {
  opacity: 1;
}

/* -- Project -- */

section#project {
  height: calc(100svh - 30px);
  height: calc(100vh - 30px);
  height: calc(100dvh - 30px); /* Modern browsers */
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.glide.gallery {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding-top: var(--padding-base);
  cursor: default;
}

.glide__track {
  display: flex;
  height: 100%;
  flex-direction: column;
  min-height: 0;
}

.glide__slides {
  display: flex;
  flex: 1 1 auto;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.glide__slide {
  display: flex;
  height: 100%;
  justify-content: center;
  align-items: center;
  align-self: center;
}

.glide__slide .video-wrapper, 
.glide__slide .image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.glide__slide .video-wrapper video, 
.glide__slide .image-wrapper img {
    opacity: 0;
    transition: 0.5s ease; 
}

/* image specific */
.image-wrapper {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 800px;
  overflow: hidden;
}

.glide__slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* videos specific */
.video-wrapper{
  max-width: 100%;
  max-height: 100%;
  max-height: 800px;
  position: relative;
  overflow: hidden;
}


.video-wrapper.ratio-4x5 { /* Portrait */
  aspect-ratio: 4/5;
  height: 100%;
}

video.ratio-4x5  {
  aspect-ratio: 16/9;
  height: 100%;
}

.video-wrapper.ratio-9x16  {
  aspect-ratio: 9 / 16;
   height: 100%;
}

video.ratio-9x16  {
  aspect-ratio: 9/16;
  height: 100%;
}

.video-wrapper.ratio-16x9  { /* Landscape */
  aspect-ratio: 16/9;
  width: 100%;
}

video.ratio-16x9  {
  aspect-ratio: 16/9;
  width: 100%;
}

.video-wrapper.ratio-1x1 { /* Square */
  aspect-ratio: 1/1;
  max-width: 100%;
  max-height: 100%;
}

video.ratio-1x1  {
  aspect-ratio: 1/1;
  max-width: 100%;
  max-height: 100%;
}

body.glide-mounted .glide__slide video, body.glide-mounted .glide__slide img {
  opacity: 1;
}

.glide__slide--active video {
  opacity: 1;
  cursor: pointer;
}

.glide__slide--active video.playing {
  opacity: 1;
  animation: none;
}

/* Video's Controls */
body .glide__slide .video-control {
  opacity: 0;
}

body.glide-mounted .glide__slide .video-control {
  opacity: 1;
}

.glide__slide .video-control {
  display: none;
}

.glide__slide--active .video-control {
  display: block;
  position: absolute;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 22px;
  padding: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  color: white;
  font-size: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.video-control img {
  width: 100% !important;
  height: 100% !important;
  opacity: 1 !important;
  border: none;
}

.video-control:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.no-sound:hover {
  background-color: rgba(0, 0, 0, 0.5);
  cursor: default;
}

/* play/pause */
.glide__slide--active .video-control--toggle-play {
  display: none;
  top: 50%;
  left: 50%;
  pointer-events: none;
}

.glide__slide--active .video-control--toggle-play.display {
  display: block;
}

/* mute/unmute */
.video-control--toggle-mute img {
  display: none;
}
.video-control--toggle-mute img.active {
  display: block;
}

.glide__slide--active .video-control--toggle-mute {
  bottom: 14px;
  right: 14px;
}

/* Glide's Controls */
.glide__nav {
  display: flex;
  gap: 2px;
  justify-content: space-between;
  margin-top: 5px;
  padding: var(--padding-base);
  padding-bottom: 0px;
}

.project-arrow {
  width: 50px;
}

.project-arrow--right {
  display: flex;
  justify-content: end;
}

.project-number__btn,
.project-arrow__btn {
  background-color: transparent;
  border: none;
  padding: 0px;
  font-family: "GT America", Arial, sans-serif;
  font-size: var(--font-size-base);
  font-weight: var(--font-light);
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.project-number__btn {
  padding: 0px 2px;
}

.project-number__btn.glide__bullet--active {
  font-weight: var(--font-medium);
}

#pagination,
#project-info {
  padding: calc(var(--padding-base) + 30px) var(--padding-base)
    var(--padding-base);
  flex: 0 0 auto;
}

#project-info h2,
h3 {
  padding-bottom: 3px;
  display: inline-block;
  font-weight: var(--font-light);
}

#project-info h2 {
  font-weight: var(--font-medium);
}

#project-info .dot {
  font-weight: var(--font-bold);
}

#project-info h3 {
  display: inline;
}

.dot {
  font-weight: var(--font-);
}

/* -- Error and Legal page -- */
section#legal,
section#error {
  padding: var(--padding-base);
}

section#legal h2,
section#error h2 {
  margin-bottom: var(--padding-base);
}

section#error {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

section#error p {
  text-align: center;
}

#legal p {
  margin-bottom: 7px;
  max-width: 600px;
}

/* -- Footer -- */
footer {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--padding-base);
  padding-bottom: var(--padding-base);
  flex-shrink: 0;
}

.footer-left {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: max-content;
}

.footer-right {
  margin-left: auto;
  text-align: right;
  min-width: 100px;
}

footer p {
  display: inline-block;
}

/* -- Responsive -- */

/* Touch screen devices */
@media (hover: none) {
  .client-name {
    opacity: 1;
  }

  .media-number {
    opacity: 1;
  }
}

/* Tablet */
@media (max-width: 1200px) {
  * {
    font-size: var(--font-size-medium) !important;
    line-height: 1.2 !important;
  }

  .hero-video-wrapper {
    aspect-ratio: 1/1;
  }

  ul.projects {
    grid-template-columns: repeat(3, 1fr);
  }

  .media-number,
  .client-name {
    font-size: clamp(0.5rem, 1.4vw, var(--font-size-medium)) !important;
  }

  .projects video.entered {
    opacity: 1;
  }

  footer p,
  footer a {
    font-size: var(--font-size-base) !important;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .hero-video-wrapper {
    aspect-ratio: 3/4;
    height: auto;
    max-height: 70vh;
  }

  #info {
    max-width: 100%;
  }

  #contact li {
    text-align: left;
    margin-bottom: var(--padding-base);
  }

  ul.projects {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-item a {
    padding: 22%;
  }

  .project-item_label {
    grid-template-columns: 22% 1fr;
  }

  .media-number,
  .client-name {
    font-size: clamp(0.65rem, 1.8vw, var(--font-size-medium)) !important;
  }

  section#project {
    height: calc(100svh - 30px);
    height: calc(100vh - 30px);
    height: calc(100dvh - 30px); /* Modern browsers */
  }

  .footer-left {
    position: relative;
    transform: none;
    left: 0%;
  }
}
