/* Debug */
/* * {
  outline: 1px solid red;
} */

/* Reset */
*,
*:after,
*:before {
  margin: 0;
  padding: 0;
}

/* Base */
html {
  --projNumWidth: 45px;
  /* width of view, back, exit buttons */
  --rightsideButtonWidth: 40px;
  --centeredTextWidth: 556px;
  --lineHeight: 24px;
  --verticalMargin: 14px;
  --horizontalMargin: 16px;
  /* To get things aligned symmetrically with the project title */
  --maxContentWidth: calc(100% - (2 * var(--projNumWidth)));

  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(16px, 2.2vw, 22px);
  letter-spacing: 0.75px;
  word-spacing: -1px;
  line-height: 1.09;
  -webkit-text-stroke: 0.35px black;
  /* Prevent scrolling on project pages due to Safari URL bar */
  height: 100%;
  height: -webkit-fill-available;
}

/* Text selection styling - light pink */
::selection {
  background-color: #ffb6c1;
  color: #000;
}

::-moz-selection {
  background-color: #ffb6c1;
  color: #000;
}

body {
  /* needs a position property set for `position: absolute` on #mqr to work */
  position: relative;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background-color: var(--siteColor);
}

/* Prevent scrolling on project pages due to Safari URL bar */
/* This will be applied via JavaScript, but CSS provides fallback */

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

li {
  list-style: none;
}

div {
  display: inline-block;
}

button {
  font-size: inherit;
  line-height: inherit;
  font-family: inherit;
  letter-spacing: inherit;
  background: inherit;
  border: none;
  background: white;
  cursor: pointer;
  color: black;
}

a:focus,
button:focus {
  outline: none;
}

/* Barba */
body.transitioning {
  pointer-events: none;
}

/* Hide loader background during transitions to prevent flash */
body.transitioning .loader {
  background-color: transparent !important;
  opacity: 0 !important;
}

/* Ensure loader background doesn't show through on project pages */
/* JavaScript will handle hiding, but this ensures background is transparent */
div[data-barba-namespace="project"] ~ .loader {
  background-color: transparent !important;
}

body.transitioning > div {
  position: absolute;
}

body.transitioning > .exiting {
  position: fixed;
  clip-path: inset(0%);
  will-change: clip-path;
  transition: clip-path linear 1050ms;
  z-index: 10;
}

body.transitioning > .entering {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  visibility: visible;
  z-index: 11;
}

div[data-barba="container"] {
  min-height: 100vh;
  width: 100%;
  padding: 14px 16px;
  box-sizing: border-box;
  background-color: white;
}

div[data-barba="container"][data-barba-namespace="project"] {
  padding: 0;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  overflow: hidden; /* Keep container from scrolling, but allow .tinted-bg to scroll */
}

div[data-barba-namespace="project"] .tinted-bg {
  height: 100%;
  width: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100dvh;
  max-height: none; /* Allow content to exceed viewport */
  padding: 14px 16px;
  padding-bottom: calc(
    14px + 42px
  ); /* Add space for marquee (30px height + 12px bottom) */
  box-sizing: border-box;
  background-color: var(--siteColorTinted);
  overflow-y: auto; /* Allow vertical scrolling when content exceeds viewport */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

/* Ensure content fits within viewport on project pages */
/* Allow content to shrink if needed to fit marquee */
div[data-barba-namespace="project"]
  .tinted-bg
  > *:not(.marquee):not(.marquee-spacer) {
  flex-shrink: 1;
  min-height: 0;
  overflow: hidden;
}

/* Project-specific background colors */
div[data-project-color="#cf6aa8"] .tinted-bg {
  background-color: #cf6aa8;
}

div[data-project-color="#b8a4c1"] .tinted-bg {
  background-color: #b8a4c1;
}

div[data-project-color="#2a798b"] .tinted-bg {
  background-color: #2a798b;
}

div[data-project-color="#d5d7d9"] .tinted-bg {
  background-color: #b8babc;
}

.pay {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 22px;
  letter-spacing: 0.75px;
  word-spacing: -1px;
  line-height: 24px;
  -webkit-text-stroke: 0.35px black;
  background-color: rgba(255, 255, 255, 0);
  border: 2px solid black;
  width: 265px;
  margin-top: 5px;
  padding-bottom: 3px;
  height: 47px;
  text-align: center;
  border-radius: 40px;
  margin-left: -2px;
}

/* INTRODUCTION */
.centered-list {
  --stWidth: 32px;

  position: relative;
  left: calc(var(--stWidth) / 2);
  width: calc(var(--centeredTextWidth) - var(--stWidth));
  align-content: center;
  text-align: start;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.centered {
  width: var(--centeredTextWidth);
  display: block;
  margin: 0 auto;
  text-align: start;
}

#introduction ul li::before {
  content: "NK";
  position: absolute;
  transform: translateX(-125%);
}

#info #contact {
  text-align: center;
}

#introduction {
  padding-top: 191px;
  padding-bottom: 191px;
}

#info {
  padding-top: 191px;
  padding-bottom: 191px;
  width: 100%;
}

#footer {
  padding-bottom: 14px;
}

#headerContainer {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--lineHeight);
}

.headerContentWrapper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.headerContentWrapper > p {
  margin: 0;
  padding-left: 0;
  box-sizing: border-box;
  text-align: left;
}

#infoButton {
  color: black;
  height: fit-content;
  border-bottom: 2px solid white;
  margin-left: 0;
  align-self: flex-start;
  white-space: nowrap;
}

div[data-barba-namespace="project"] #headerContainer {
  margin-bottom: var(--lineHeight);
}

#homepage {
  visibility: hidden;
}

/* PROJECTS */
.projects {
  width: 100%;
}

.project {
  width: 100%;
}

div[data-barba-namespace="homepage"] .project {
  cursor: url("cursor.png") 8 20, auto !important;
}

div[data-barba-namespace="homepage"] .project .projectLabel,
div[data-barba-namespace="homepage"] .project .projectTitle,
div[data-barba-namespace="homepage"] .project .projectDate,
div[data-barba-namespace="homepage"] .project .projectCounter,
div[data-barba-namespace="homepage"] .project .projectSubtitle,
div[data-barba-namespace="homepage"] .project .projectMeta {
  cursor: default !important;
}

.projectLabel {
  margin-right: 20px;
  display: inline;
}

.projectLabel:last-of-type {
  margin-right: 0;
}

.projectLabelNum {
  width: var(--projNumWidth);
  float: left;
}

.projectLabelContainer {
  width: calc(100% - var(--projNumWidth));
}

.projectMeta {
  display: block;
  /* max-width on this prevents long titles from breaking to next line */
  max-width: calc(100% - var(--rightsideButtonWidth) - 10px);
  margin-bottom: var(--lineHeight);
  /* Allow wrapping on smaller screens */
  min-width: 0;
}

.projectMetaRow {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  text-align: left;
}

.projectMetaRow:first-child {
  margin-bottom: 0;
}

.projectMetaLeft {
  display: flex;
  align-items: baseline;
  gap: 60px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.projectTitle {
  flex: 0 0 auto;
  margin-right: 0;
  /* Allow title to wrap on smaller screens */
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.projectDate {
  flex: 0 0 auto;
  margin-right: 0;
}

.projectCounter {
  flex: 0 0 auto;
  margin-right: 0;
  margin-left: 0;
}

.projectSubtitle {
  margin-right: 0;
}

.projectView {
  float: right;
  color: black;
  padding-bottom: 1px;
  text-decoration: none;
  box-sizing: content-box;
  border-bottom: 2px solid white;
}

div[data-barba-namespace="project"] .projectMeta {
  margin-bottom: calc(var(--lineHeight) * 2);
}

#lightbox .projectLabelContainer {
  position: relative; /* need this for z-indexing */
  z-index: 10;
}

.projectDescriptionContainer {
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  color: black;
  background-color: var(--siteColor);
  -webkit-text-stroke: 0.35px black;
  position: absolute;
}

.projectDescription {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  width: var(--centeredTextWidth);
  max-width: calc(100% - 80px); /* container padding is 40px */
  text-align: start;
  hyphens: auto;
  cursor: default;
}

.projectDescription p:not(:first-child) {
  text-indent: var(--projNumWidth);
}

.projectText {
  display: block;
  margin: var(--lineHeight) auto;
  /* 
    1101px bc 1101 / 1.5 (the natural aspect ratio of the images) is a whole number, 
    1100px causes a 1px line to appear at the bottom of text slides
  */
  width: 1101px;
  max-width: var(--maxContentWidth);
  text-align: start;
}

.projectText p:not(:first-of-type) {
  text-indent: var(--projNumWidth);
}

/* CAROUSEL */
.slide {
  overflow: hidden;
  position: absolute;
  top: 0;
  height: 100%;
  width: 100%;
  z-index: 1;

  clip-path: inset(0%);
  will-change: clip-path;
  /* 
    We're setting and unsetting `transition` using JS to prevent an unsightly reverse animation 
    when overlayed images haven't loaded yet. Leaving this rule here for documentation.
  */
  /* transition: clip-path linear 1050ms; */

  line-height: 24px;
}

.slide:nth-of-type(1) {
  z-index: 3;
}

.slide img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: auto;
  width: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  z-index: 2;
}

div[data-barba-namespace="homepage"] .slide img,
div[data-barba-namespace="homepage"] .slide-content,
div[data-barba-namespace="homepage"] picture.slide-content,
div[data-barba-namespace="homepage"] img.slide-content {
  cursor: url("cursor.png") 0 0, auto !important;
}

.carouselArea {
  position: fixed;

  height: auto;
  /* 
    1101px bc 1101 / 1.5 (the natural aspect ratio of the images) is a whole number, 
    1100px causes a 1px line to appear at the bottom of text slides
  */
  width: 1101px;
  max-width: var(--maxContentWidth);
  aspect-ratio: 1.5; /* doesn't work on iOS 14 so we'll use the padding aspect-ratio workaround */

  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 14px 0;

  /* fixes extra height added by using the aspect-ratio workaround */
  line-height: 0;
}

div[data-barba-namespace="homepage"] .carouselArea .carouselContainer,
div[data-barba-namespace="homepage"] .carouselArea .slide,
div[data-barba-namespace="homepage"] .carouselArea .slide picture,
div[data-barba-namespace="homepage"] .carouselArea .slide img {
  cursor: url("cursor.png") 8 20, auto !important;
}

.videography-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
  margin-left: auto;
  margin-right: auto;
  max-width: 1190px;
  width: 100%;
  justify-content: center;
}

.video-thumbnail {
  display: block;
  width: 219px;
  max-width: 219px;
  flex: 0 0 219px;
  cursor: url("LUPA.png") 16 16, pointer !important;
}

.video-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 1090px) {
  .videography-grid {
    max-width: 990px;
  }
}

@media (max-width: 900px) {
  .videography-grid {
    gap: 15px;
    max-width: 760px;
  }
}

@media (max-width: 800px) {
  .videography-grid {
    gap: 14px;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }
  .video-thumbnail {
    width: calc(50% - 7px);
    max-width: calc(50% - 7px);
    flex: 0 0 calc(50% - 7px);
  }
}

@media (max-width: 710px) {
  .videography-grid {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .videography-grid {
    gap: 12px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .video-thumbnail {
    width: calc(50% - 6px);
    max-width: calc(50% - 6px);
    flex: 0 0 calc(50% - 6px);
  }
}

.relative {
  position: relative !important;
  top: 0;
  transform: translate(-50%, 0);
}

/* LOADER */
.loaderContainer {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: visible;
}

.loader-text {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  word-spacing: 2px;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  -webkit-text-stroke-width: 0 !important;
  -webkit-text-stroke-color: transparent !important;
}

.loader-signature {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  z-index: 5;
}

.loader-signature img {
  height: 90vh;
  width: auto;
  filter: brightness(0) invert(1);
  transform: rotate(-90deg);
  display: block;
  object-fit: contain;
  max-width: 100vh;
}

.loader {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background-color: var(--siteColor);
  clip-path: inset(0%);
  transition: clip-path 2s linear;
  will-change: clip-path;
  overflow: visible;
  display: block;
}

#spacer {
  visibility: hidden;
}

.mobile-andmore {
  display: none;
}

.full-w {
  width: 100%;
}

.full-w-margins {
  margin: var(--lineHeight) auto;
  width: 1101px;
  max-width: var(--maxContentWidth);
  text-align: start;
  display: block;
}

.marquee {
  position: fixed;
  /* Use fixed positioning to account for Safari URL bar */
  bottom: 12px;
  left: 0;
  margin: 0 auto;
  padding-bottom: 2px;
  width: 100%;
  height: 30px;
  overflow: hidden;
  text-align: center;
  display: flex;
  align-items: center;
  white-space: nowrap;
  z-index: 5; /* Above content but below modals */
}

.marquee p {
  display: inline;
  font-size: 22px !important;
  -webkit-text-size-adjust: 100%;
}

.marquee-spacer {
  width: 100%;
}

@keyframes ellipsis {
  to {
    width: 1.25em;
  }
}
@-webkit-keyframes ellipsis {
  to {
    width: 1.25em;
  }
}

/* Thumbnail Grid  */
/* CURRENT STATE (for reverting if needed):
.gridContainer {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  width: 1101px;
  max-width: var(--maxContentWidth);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}
*/
.gridContainer {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  width: 1101px;
  max-width: var(--maxContentWidth);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
  /* Dynamic sizing will be applied via JavaScript */
}

/* Grid items on project view pages - LUPA cursor */
div[data-barba-namespace="project"] .grid-item {
  box-sizing: border-box;
  cursor: url("LUPA.png") 16 16, pointer !important;
  height: auto;
  width: 100%;
  /* Ensure clicks/touches work on all devices */
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
}

div[data-barba-namespace="project"] picture.grid-item img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: center;
  /* Ensure images don't block clicks */
  pointer-events: none;
  user-select: none;
}

div[data-barba-namespace="project"] picture.grid-item {
  /* Ensure the picture element itself is clickable */
  pointer-events: auto !important;
  display: block;
  cursor: url("LUPA.png") 16 16, pointer !important;
  position: relative;
  z-index: 1;
}

/* Lightbox */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding: 0;
  box-sizing: border-box;
  visibility: hidden;
  background-color: var(--siteColor);
  z-index: 10;
  transition: background-color 0.3s ease;

  clip-path: inset(0% 0% 0% 100%);
  will-change: clip-path;
}

#lightbox .tinted-bg {
  width: 100%;
  height: 100%;
  padding: 14px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#lightbox #headerContainer,
#lightbox .projectLabelContainer,
#lightbox > .tinted-bg > div:not(.carouselArea) {
  padding-left: 0;
  padding-right: 0;
  flex-shrink: 0;
}

#lightbox.open {
  visibility: visible;
  clip-path: inset(0%);
  cursor: url("X.png") 16 16, pointer !important;
}

.carouselContainer {
  /* workaround for iOS 14, aspect-ratio in the parent container is not supported */
  /* https://stackoverflow.com/a/29194256 */
  padding-bottom: calc(100% / 1.5);
}

div[data-barba-namespace="homepage"] .carouselContainer {
  cursor: url("cursor.png") 8 20, auto;
}

#lightbox .carouselArea {
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible !important;
}

@media only screen and (max-width: 1000px) {
  #lightbox .carouselArea {
    padding: 0;
  }
}

/* Tablet responsiveness */
@media only screen and (max-width: 1024px) and (min-width: 801px) {
  html {
    font-size: clamp(18px, 2vw, 22px);
  }

  .projectTitle {
    font-size: clamp(16px, 2.5vw, 22px);
    line-height: 1.15;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    min-width: 0;
  }

  .projectMetaLeft {
    gap: 30px;
  }
}

#lightbox .carouselContainer {
  /* unset aspect-ratio workaround */
  padding-bottom: 0;

  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  margin: 0;
  left: 0;
  top: 0;
  overflow: visible !important;
}

#lightbox .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  cursor: url("X.png") 16 16, pointer !important;
  /* Enable pinch-to-zoom on touch devices */
  touch-action: pan-x pan-y pinch-zoom;
  -ms-touch-action: pan-x pan-y pinch-zoom;
}

#lightbox .slide picture.slide-content {
  /* center the picture element - remove all constraints */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  aspect-ratio: unset !important;
  overflow: visible;
  cursor: url("X.png") 16 16, pointer !important;
  /* Enable pinch-to-zoom on touch devices */
  touch-action: pan-x pan-y pinch-zoom;
  -ms-touch-action: pan-x pan-y pinch-zoom;
  /* Ensure picture container centers its content */
  margin: auto;
  align-self: center;
}

#lightbox .slide img.slide-content {
  /* center the image - scale to fit container */
  position: relative;
  display: block;
  width: auto;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  overflow: visible;
  cursor: url("X.png") 16 16, pointer !important;
  /* Enable pinch-to-zoom on touch devices */
  touch-action: pan-x pan-y pinch-zoom;
  -ms-touch-action: pan-x pan-y pinch-zoom;
  /* Ensure image is centered */
  margin: auto;
  align-self: center;
}

.leftButton {
  opacity: 0;
  /* margin-top: 16px; */
  position: absolute;
  width: 50%;
  left: 0;
  top: 0;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

#lightbox .leftButton {
  display: none;
}

div[data-barba-namespace="homepage"] .leftButton {
  cursor: url("cursor.png") 8 20, auto;
  pointer-events: auto;
}

div[data-barba-namespace="homepage"] .leftButton:hover {
  cursor: url("cursor-left.png") 24 20, auto;
}

.rightButton {
  /* margin-top: 16px; */
  opacity: 0;
  position: absolute;
  width: 50%;
  top: 0;
  left: 50%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

#lightbox .rightButton {
  display: none;
}

div[data-barba-namespace="homepage"] .rightButton {
  cursor: url("cursor.png") 8 20, auto;
  pointer-events: auto;
}

#exit,
#close {
  float: right;
  color: black;
  padding-bottom: 1px;
  text-decoration: none;
  box-sizing: content-box;
  border-bottom: none;
  cursor: pointer;
  margin: 0;
  border-bottom: 2px solid transparent;
  position: relative;
  z-index: 100;
  pointer-events: auto !important;
}

.mobileprojectDescription {
  display: none;
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  width: 100%;
  top: 50%;
  padding: 40px;
  box-sizing: border-box;
}

#mobile-contact {
  display: none;
  text-align: center;
  width: 100%;
}

/* Screensaver */
#screensaver {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100%;
  clip-path: inset(0% 0% 0% 100%);
  will-change: clip-path;
  transition: clip-path linear;
  z-index: 1000;
  cursor: pointer;
}

#screensaver.visible {
  pointer-events: all;
  clip-path: inset(0%);
  transition-duration: 2000ms;
}

#screensaver.instant {
  pointer-events: all;
  clip-path: inset(0%);
}

#screensaver.exiting {
  clip-path: inset(0% 100% 0% 0%);
  transition-duration: 2000ms;
}

#screensaver img {
  object-fit: cover;
  height: 100%;
  width: 100%;
}

#screensaver .ss-caption {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% - 32px);
  padding: 14px 16px;
}

.ss-container {
  height: 100%;
  width: 100%;
}

.ss-container.hidden {
  display: none;
}

#btt-button {
  position: fixed;
  bottom: 14px;
  right: 16px;
  padding: 7.5px 7px 7.5px 10px;
  border-radius: 5px;
  box-shadow: 0px 0px 10px 0 rgba(0, 0, 0, 0.25);
  background-color: var(--siteColor);
}

#btt-button,
#project-buttons {
  transition: opacity 0.5s ease-in-out;
  opacity: 0;
  pointer-events: none;
}

#btt-button.visible,
#project-buttons.visible {
  opacity: 1;
  pointer-events: all;
}

/* Hoverable */
@media (any-hover: hover) {
  /* Prevent hoverstates on mobile */
  .projectView:hover,
  #infoButton:hover,
  #exit:hover,
  #close:hover {
    border-bottom: 2px solid currentColor;
  }
}

/* Mobile */
@media only screen and (max-width: 800px) {
  html {
    font-size: clamp(14px, 3.5vw, 18px);
  }

  body {
    --projNumWidth: 35px;
    overflow-x: hidden;
  }

  div[data-barba="container"] {
    overflow-x: hidden;
  }

  div[data-barba-namespace="project"] .tinted-bg {
    overflow-x: hidden;
  }

  .mobile-andmore {
    display: inline;
  }

  .desktop {
    display: none;
  }

  #mobile-contact {
    display: block;
  }

  .centered-list {
    width: calc(100% - var(--stWidth));
    text-align: left;
  }

  #introduction {
    text-align: left;
    padding: 48px 0px;
  }

  .centered-list {
    --stWidth: 36px;
  }

  #introduction {
    width: calc(100% - var(--projNumWidth));
  }

  #introduction ul li::before {
    /* move it a smidge to the left */
    transform: translateX(calc(calc(var(--projNumWidth) + 1px) * -1));
  }

  .projectLabel {
    margin-right: 9px;
  }

  /* Responsive project title scaling */
  .projectTitle {
    font-size: clamp(12px, 3vw, 16px);
    line-height: 1.3;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
    width: 100%;
    min-width: 100%;
  }

  .projectMetaLeft {
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
  }

  .projectMeta {
    max-width: calc(100% - 60px);
    min-width: 0;
    text-align: left;
    margin-right: 60px;
  }

  .projectMetaRow {
    min-width: 0;
    justify-content: flex-start;
  }

  .projectMetaLeft {
    justify-content: flex-start;
  }

  .projectLabelContainer {
    width: 100%;
    min-width: 0;
  }

  #info {
    width: 100%;
    text-align: left;
    padding: 48px 0px;
  }

  #contact {
    width: 100%;
  }

  .projectDescriptionContainer {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .projectDescription {
    box-sizing: border-box;
    width: 100%;
    padding: 40px;
  }

  .projectDescription {
    display: none;
  }

  .mobileprojectDescription {
    display: inline-block;
    text-align: center;
  }
  .gridContainer {
    grid-template-columns: 1fr 1fr;
  }

  .full-w-margins,
  .projectText {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  .projectText {
    font-size: clamp(14px, 3.5vw, 18px);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .projectText p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }

  #headerContainer {
    display: block;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .headerContentWrapper {
    width: 100%;
    overflow: hidden;
  }

  .headerContentWrapper::before {
    content: "";
    width: var(--projNumWidth);
    float: left;
    height: 1px;
  }

  .headerContentWrapper > p:first-of-type {
    padding-left: 0;
    margin-left: 0;
    box-sizing: border-box;
    margin-right: 60px;
    overflow: hidden;
  }

  #headerContainer p,
  #headerContainer a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }

  #infoButton {
    margin-left: 0;
    float: right;
    clear: none;
  }

  .carouselArea,
  .projectText,
  .gridContainer,
  .full-w-margins {
    max-width: 100%;
  }

  .carouselArea.shortened {
    max-width: calc(100% * 0.75);
  }

  /* Loader text - make smaller on mobile to maintain layout */
  .loader-text {
    font-size: clamp(15px, 3.7vw, 22px);
    left: 16px;
    letter-spacing: 0.5px;
    word-spacing: 1px;
  }

  .loader-signature {
    width: 120px;
  }

  .loader-signature img {
    height: 70vh;
    max-width: 100vh;
  }

  /* Hide header content and project info in lightbox on mobile to maximize image space */
  /* But keep exit button visible */
  #lightbox.open #headerContainer p {
    display: none !important;
  }

  #lightbox.open #headerContainer #headerLine {
    display: none !important;
  }

  #lightbox.open .projectLabelContainer {
    display: none !important;
  }

  /* Ensure exit button is visible and accessible - fixed position at top */
  #lightbox.open #headerContainer {
    position: relative !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  #lightbox.open #exit {
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 200 !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    padding-bottom: 1px !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    color: black !important;
    float: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    font-family: inherit !important;
    letter-spacing: inherit !important;
    text-decoration: none !important;
    box-sizing: content-box !important;
    margin: 0 !important;
  }

  /* Remove all padding from lightbox on mobile */
  #lightbox.open .tinted-bg {
    padding: 0 !important;
  }

  /* Ensure carousel area takes full space on mobile, but leave room for marquee */
  #lightbox.open .carouselArea {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: calc(
      100% - 42px
    ) !important; /* Leave space for marquee (30px height + 12px bottom) */
    flex: 1 1 auto !important;
  }

  /* Ensure marquee from main container is visible above lightbox on mobile */
  /* The marquee is in the project container, not the lightbox */
  /* When lightbox is open, make marquee appear above it */
  #lightbox.open ~ div[data-barba="container"] .marquee,
  body:has(#lightbox.open) div[data-barba-namespace="project"] .marquee {
    position: fixed !important;
    bottom: 12px !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 15 !important; /* Above lightbox (z-index 10) but below buttons (z-index 200) */
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
  }

  /* Fallback for browsers that don't support :has() */
  div[data-barba-namespace="project"] .marquee {
    z-index: 15 !important;
  }

  /* Center image perfectly in lightbox on mobile */
  #lightbox.open .carouselContainer {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #lightbox.open .slide {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #lightbox.open .slide picture.slide-content,
  #lightbox.open .slide img.slide-content {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Show and style left/right navigation buttons on mobile - white background, not circular */
  #lightbox.open .leftButton,
  #lightbox.open .rightButton {
    display: block !important;
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: auto !important;
    height: auto !important;
    min-width: 40px !important;
    min-height: 40px !important;
    background: white !important;
    border: none !important;
    z-index: 200 !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
  }

  #lightbox.open .leftButton {
    left: 16px !important;
  }

  #lightbox.open .rightButton {
    right: 16px !important;
    left: auto !important;
  }

  /* Add arrow indicators to buttons - slightly bigger */
  #lightbox.open .leftButton::before {
    content: "←" !important;
    font-size: 1.2em !important;
    color: black !important;
    font-weight: normal !important;
    font-family: inherit !important;
    letter-spacing: inherit !important;
    line-height: inherit !important;
  }

  #lightbox.open .rightButton::before {
    content: "→" !important;
    font-size: 1.2em !important;
    color: black !important;
    font-weight: normal !important;
    font-family: inherit !important;
    letter-spacing: inherit !important;
    line-height: inherit !important;
  }
}

.pointer-events-none {
  pointer-events: none;
}

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  padding: 0 16px 14px;
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: space-between;
  box-sizing: border-box;
  pointer-events: none;
}

#project-buttons,
#project-buttons ul {
  display: flex;
}

#project-buttons li {
  padding-right: 10px;
}

#project-buttons #prev {
  margin-right: 10px;
}

#project-buttons button {
  width: fit-content;
  color: black;
  text-align: center;
  padding: 10px;
  padding-top: 7px;
  padding-bottom: 8px;
  background-color: var(--siteColor);
  border-radius: 5px;
  box-shadow: 0px 0px 10px rgb(0 0 0 / 0.25);
  position: relative;
}

#project-buttons button .title {
  display: none;
}

.hnum {
  z-index: 1000;
  box-sizing: content-box;
  width: fit-content;
  text-align: center;
  padding: 10px;
  padding-top: 7px;
  padding-bottom: 8px;
  padding-right: 20px;
  border-radius: 5px;
  outline: 1px solid red;
  display: block;
  /* Comment the below line for visual debugging */
  opacity: 0;

  position: absolute;
  top: 0;
  left: 0;
}

#project-buttons li:last-of-type .hnum {
  padding-right: 10px;
}

@media (any-hover: hover) and (min-width: 1024px) {
  .hnum:hover ~ .num {
    display: none;
  }

  .hnum:hover ~ .title {
    display: block !important;
  }
}
