@font-face {
  font-family: Outfit-Bold;
  src: url(fonts/Outfit-Bold.ttf);
}

@font-face {
  font-family: Outfit-Medium;
  src: url(fonts/Outfit-Medium.ttf);
}

@font-face {
  font-family: Outfit-Regular;
  src: url(fonts/Outfit-Regular.ttf);
}

@font-face {
  font-family: Outfit-Black;
  src: url(fonts/Outfit-Black.ttf);
}

@font-face {
  font-family: Outfit-Light;
  src: url(fonts/Outfit-Light.ttf);
}

@font-face {
  font-family: Outfit-Black;
  src: url(fonts/Outfit-Black.ttf);
}

/* Ensure the page has a minimum height of 250px */
html, body {
    min-height: 250px; /* Set the minimum height */
    height: 100%; /* Ensure the page takes up the full height of the viewport */
    margin: 0; /* Remove default margin */
    padding: 0%; /* Remove default padding */
    box-sizing: border-box; /* Include padding and border in element's total width/height */
}

.fade-in-section {
  opacity: 0;
  transform: translateY(20vh);
  visibility: hidden;
  transition: opacity 0.6s ease-out, transform 1.2s ease-out;
  will-change: opacity, visibility;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: none;
  visibility: visible;
}

/* Initial state for fade-in effect */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.42, 0, 0.58, 1), transform 0.6s cubic-bezier(0.42, 0, 0.58, 1);
}

/* When the element is visible */
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

*{
    margin: 0;
    padding:0;
    font-family:"Arial";
    box-sizing: border-box;
}

body{
    background: #fff;
    color: #fff;
}

#header{
}

.container{
    padding: 35px 4%;
    background-color: #000;
    overflow: hidden;
    position: fixed; /* Set the navbar to fixed position */
    top: 0; /* Position the navbar at the top of the page */
    width: 100%; /* Full width */
    z-index: 1;
}

.container2 {
    display: flex;
    align-items: flex-end;
    height: 63vh;
    margin-top: 0%;
    width: 100%;
    background-image: url(images/work_background.png);
    background-size: cover;
    background-position: center;
    padding-bottom: 100px;
    padding-left: 4%; /* Aligns with .container3 and .container */
}

nav{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo{
    width: 315px;
}

nav ul li{
    display: inline-block;
    list-style: none;
    margin: 10px 40px;
    margin-right: 0;
}

nav ul li a{
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    position: relative;
    letter-spacing: 5px;
    font-family: Outfit-Bold;
}

nav ul li a::after{
    content: '';
    width: 0%;
    height: 3px;
    background: #60CF8A;
    position: absolute;
    left: 0;
    bottom: -10px;
    transition: 0.3s;
}

nav ul li a:hover::after{
    width: 100%;
}

#contact_link{
    width: 300px;
    border: solid white 1px;
    padding: 10px;
    padding-left: 15px;
    font-family: Outfit-Bold; /* Ensure CONTACT uses Outfit-Bold */
}

/* Initial state for the text animation */
.header-text {
    opacity: 0;
    transform: translateX(-100%);
    animation: slide-in-with-opacity 0.9s cubic-bezier(0.42, 0, 0.58, 1) forwards;
}

/* Keyframes for the slide-in animation with opacity */
@keyframes slide-in-with-opacity {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0); /* No extra shift */
    }
}

.header-text p{
    font-size: 20px;
    font-family:Outfit-Medium;
    letter-spacing: 5px;
}

.header-text p span{
    font-family: "Courier New";
}

.header-text h1{
    font-size: 48px;
    margin-top:20px;
    font-family:Outfit-Bold;
    line-height: 120%;
}

.header-text h1 span{
    color: #60CF8A;
    font-family: Outfit-Bold;
}

/*---------text react to screen size change----------*/
@media(max-width:1020px){
    .header-text h1{
        font-size: 42px;
    }
}

@media(max-width:900px){
    .header-text h1{
        font-size: 36px;
    }
}

/*--------portfolio--------------*/

.container3{
    padding: 40px 4%;
    color: #000;
    margin-top:-20px;
}

.container3 h1{
    font-size: 48px;
    font-family: Outfit-Bold;
}

.container3 h1 span{
    color: #60CF8A;
    font-family: Outfit-Bold;
}

/* Reduce the space below "Portfolio." */
.container3 h1.sub-title {
  margin-bottom: 30px; /* Reduce the bottom margin of the "Portfolio." heading */
}

#portfolio{
    padding: 10px 0;

}

.work-list{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    grid-gap: 8px;
    margin-top:20px; /* Reduce the top margin of the work list */
}

.work{
    position: relative;
    overflow: hidden;
}

.work img{
    width: 100%;
    display: block;
    transition: transform 0.3s;
    transition: transform 0.3s;
}

.work video{
    width: 100%;
    display: block;
    transition: transform 0.3s;
    transition: transform 0.3s;
}

#small_text{
    margin-left: 20px;
    color: #000;
    font-size: 16px;
    letter-spacing: 4px;
    font-family: Outfit-Light;
}

#small_but_bold{
    color: #000;
    font-family: Outfit-Black;
}

.layer{
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    opacity: 0%;
    transition: opacity 0.3s;
}

.layer h3{
    font-family: Outfit-Medium;
    font-size: 32px;
    color: #fff;
    margin-bottom: 20px;
}

.layer p{
    font-family: Outfit-Light;
    font-size: 14px;
    letter-spacing: 2px;
    color: #fff;
    line-height: 25px;
}

.layer-case {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    opacity: 0%;
    transition: opacity 0.3s;
}

.layer-case h3{
    font-family: Outfit-Medium;
    font-size: 30px;
    color: #fff;
    margin-bottom: 20px;
}

.layer-case p{
    font-family: Outfit-Light;
    font-size: 14px;
    letter-spacing: 2px;
    color: #fff;
    line-height: 25px;
}

/* Style for the buttons in the overlay */
.layer-case .buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.layer-case .buttons button,
.layer-case .buttons a {
  padding: 8px 16px;
  font-size: 14px;
  font-family: "Outfit-Bold", sans-serif;
  color: #fff;
  background-color: transparent;
  border: 2px solid #fff;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.layer-case .buttons button:hover,
.layer-case .buttons a:hover {
  background-color: #fff;
  color: #000;
}

.work:hover img{
    transform: scale(1.2);

}

.work:hover video{
    transform: scale(1.2);

}

.work:hover .layer-case{
    opacity: 100%;
}

.work:hover .layer{
    opacity: 100%;
}

.footer{
    font-size: 14px;
    color: #000;
    border-style: solid;
    border-width: 2px;
    border-color: #ededed;
    padding: 40px 4%;
    letter-spacing: 3px;
}

.footer .copyright{
    color: #aaa;
    font-family: Outfit-Regular;
}

.case-study{
    margin-left: 4%;
    margin-top: 160px;
    font-size: 18px;
    font-family: Outfit-Bold;
    color: #000;
    line-height: 25px;
}

/*--.opening-image{
    background-image: url(images/bimaristan.png);
    height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    margin-top: 50px;
}--*/

.opening-image{
    min-height: 100vh;
}

.case-study h3{
    font-family: Outfit-Bold;
    font-size: 42px;
    margin-bottom: 30px;
    line-height: 45px;
    width: 96%;
}

.case-study h3 span{
    font-family: Outfit-Light;
    font-size: 42px;
}

.case-study h4{
    font-family: Outfit-Bold, Arial, sans-serif;
    font-size: 40px;
    margin-bottom: 12px;
    line-height: 45px;
    width: 96%;
    letter-spacing: 0;
    color: #000;
    font-weight: normal;
}

.case-study h4 span{
    font-family: Outfit-Bold;
    color: #60CF8A;
}

.case-study p{
    font-family: Outfit-Regular;
    margin-bottom: 20px;
    width: 96%;
}

.pic-label{
    font-family: Outfit-Regular;
    font-size: 14px;
}

.case-study-image{
    /*---height: 80vh;--*/
    width: 96%;
    margin-bottom: 20px;
}

.case-study .tri-column{
    margin-right: 4%;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.case-study .tri-column .boxed-text{
    border: solid 2px #222;
    border-radius: 0;
    padding: 8px 16px 10px 16px;/* 8px top/bottom, 16px left/right — equal on all sides visually */
    font-family: Outfit-Regular;
    font-size: 18px;
    background: #fafafa;
    color: #222;
    margin: 0;
    min-height: 40px;
    display: inline-block;
    box-sizing: border-box;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    width: auto;
    line-height: 1.2;
    white-space: nowrap;
}

/* Bold the label before the colon */
.case-study .tri-column .boxed-text span:first-child {
    font-family: Outfit-Bold;
    font-size: 18px;
}

/*---  popups  ---*/

.popup-image{
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s;
    opacity: 0;
    pointer-events: none; /* Prevent blocking when hidden/fading out */
}
.popup-image.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto; /* Allow interaction when shown */
}

.popup-image span {
    position: absolute;
    top: 24px;
    right: 40px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
}

#bimaristan-popup img,
#sperm-popup img, {
    max-height: 85vh !important;
    max-width: 90vw !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
}

.popup-image {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-image.active {
  display: flex;
}

.popup-image img {
  height: 90vh; /* Always set the height to 90% of the viewport */
  width: auto;  /* Adjust the width automatically to maintain aspect ratio */
  max-width: 100%; /* Prevent the image from exceeding the viewport width */
  object-fit: contain; /* Ensure the image fits within the container without distortion */
  border-radius: 0px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  display: block;
  margin: 0 auto;
}

.popup-main-image img {
  max-height: 70vh; /* Set the maximum height to 70% of the viewport height */
  width: auto; /* Maintain aspect ratio */
  border-radius: 0; /* Ensure no rounded corners */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5); /* Add a subtle shadow */
}

/* Add zoom effect for popup images */
.popup-main-image img {
  cursor: zoom-in; /* Change cursor to indicate zoom functionality */
  transition: transform 0.3s ease; /* Smooth transition for zoom effect */
}

.popup-main-image img.zoomed {
  cursor: zoom-out; /* Change cursor to indicate zoom-out functionality */
  transform: scale(2); /* Zoom in by scaling the image */
}

#close-portfolio-popup {
  position: absolute;
  top: 24px; /* Adjust the distance from the top */
  right: 45px; /* Move the "x" closer to the center */
  font-size: 50px; /* Keep the "x" large */
  color: #fff;
  cursor: pointer;
  z-index: 1001;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6); /* Add a subtle shadow */
}

.popup-gallery {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
  opacity: 0; /* Start with 0 opacity */
  transition: opacity 0.3s ease; /* Add a smooth transition for opacity */
}

.popup-gallery.active {
  display: flex;
  opacity: 1; /* Fade in when active */
}

.popup-gallery.hidden {
  opacity: 0; /* Fade out when hidden */
  pointer-events: none; /* Prevent interaction during fade-out */
}

.popup-main-image {
  max-height: 80vh;
  width: auto;
  margin-bottom: 16px;
}

.popup-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
}

.popup-thumbnails img {
  height: 80px; /* Set consistent thumbnail height */
  width: auto; /* Maintain aspect ratio */
  cursor: pointer;
  border-radius: 0; /* Ensure no rounded corners */
  transition: transform 0.2s ease;
}

.popup-thumbnails img:hover {
  transform: scale(1.1); /* Slightly enlarge the thumbnail on hover */
}

/* Ensure the popup background always fills the entire screen */
.popup-gallery,
.popup-image {
  position: fixed; /* Ensure it stays fixed to the viewport */
  top: 0;
  left: 0;
  width: 100vw; /* Full width of the viewport */
  height: 100vh; /* Full height of the viewport */
  min-height: 100vh; /* Ensure it covers the full viewport height */
  background: rgba(0, 0, 0, 0.8); /* Semi-transparent black background */
  z-index: 1000; /* Ensure it appears above other elements */
  display: none; /* Initially hidden */
  justify-content: center; /* Center content horizontally */
  align-items: center; /* Center content vertically */
  overflow: hidden; /* Prevent scrolling inside the popup */
}

.popup-gallery.active,
.popup-image.active {
  display: flex; /* Show the popup when active */
  opacity: 1; /* Ensure visibility */
}

.popup-gallery.hidden,
.popup-image.hidden {
  opacity: 0; /* Fade out effect */
  pointer-events: none; /* Prevent interaction during fade-out */
}

@media (max-width: 768px){
    .popup-image img{
        width: 95%;
    }
}

/*--
@media only screen and (max-width: 1300px){
    .case-study .tri-column{
        column-count: 3;
        font-family: Outfit-Regular;
    }

    .case-study .tri-column span{
        column-count: 3;
        border: solid;
        border-width: 2px;
        padding: 8px;
        padding-left: 16px;
        padding-right: 16px;
        width: fit-content;
        font-family: Outfit-Regular;
    }
}
--*/

/*--
.case-study .tri-column p span{
    column-count: 3;
    font-family: Outfit-Bold;
}
--*/

.case-study .tri-column2{
    column-count: 3;
    margin-right: 4%;
    margin-bottom: 10px;
    column-gap: 50px;
}

.case-study .tri-column2 p{
    border: solid;
    border-width: 0px;
    width: fit-content;
}

.case-study .tri-column2 p span{
    font-family: Outfit-Bold;
    font-size: 30px;
    margin-bottom: 2em; /* Adjust as needed for more/less space */
}

.column-photos{
    position: relative;
    overflow: hidden;
}

.column-photos img{
    width: 100%;
    display: block;
    margin-bottom: 5px;
}

.column-photos-list {
  display: flex;
  flex-direction: row;
  gap: 24px;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 32px;
  width: 96%;           /* Match paragraph/text width */
  margin-left: 0;
}

.column-photos {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;      /* Remove max-width restriction */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.column-photos img {
  width: 100%;
  max-width: none;      /* Remove max-width restriction */
  height: auto;
  object-fit: contain;
  border-radius: 0;     /* Remove rounded corners */
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/*-------about me page--------*/

.about-section {
  margin-top: 0;
  padding-top: 180px; /* Increase to match the start of "Contact." in contact.html */
  margin-bottom: 40px;
  padding-bottom: 120px; /* Add extra space below the about section before the footer */
}

@media (max-width: 700px) {
  .about-section {
    padding-top: 140px; /* Adjust for mobile if needed */
  }
}

.about-hero-flex {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.about-profile-pic {
  flex: 0 0 180px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.about-profile-pic img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #eee;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  background: #fafafa;
}

.about-hero-text {
  flex: 1 1 320px;
  min-width: 260px;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: 'Outfit-Regular', Arial, sans-serif; /* Use Outfit-Regular for all except heading */
}

.about-hero-text h4#about-me-text {
  font-family: Outfit-Bold, Arial, sans-serif;
  font-size: 45px;
  margin-bottom: 12px;
  line-height: 45px;
  width: 96%;
  letter-spacing: 0;
  color: #000;
  font-weight: normal;
  opacity: 1;                /* Remove fade-in */
  transform: none;           /* Remove translateY */
  transition: none;          /* Remove transition */
}

#about-me-text.fade-in,
#about-me-text.visible {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Remove fade-in animation from About Me. heading and intro paragraphs */
.about-hero-text h4#about-me-text,
.about-hero-text p.intro-no-fade {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.about-hero-text p,
.about-hero-text ul,
.about-hero-text li,
.about-hero-text a,
.about-hero-text h5,
.about-skills,
.skills-list span {
  font-family: 'Outfit-Regular', Arial, sans-serif !important;
}

.about-hero-text p {
  margin-bottom: 12px; /* Reduce space between paragraphs (default is usually 16px) */
}

.about-hero-text p.intro-no-fade:last-of-type {
  margin-bottom: 0; /* Remove extra space after the last intro paragraph if needed */
}

.about-details {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
  font-size: 1em;
}

.about-details li {
  margin-bottom: 6px;
}

.about-details li strong {
  font-family: Outfit-Bold, Arial, sans-serif;
  font-weight: normal;
}

.about-details a {
  color: #0077b5;
  text-decoration: none;
}

.about-skills {
  margin-top: 18px;
}

.about-skills h5 {
  margin: 0 0 8px 0;
  font-size: 1.1em;
  font-weight: bold;
  letter-spacing: 1px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills-list span {
  background: #f0f0f0;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 0.98em;
  color: #333;
  margin-bottom: 4px;
}

@media (max-width: 700px) {
  .about-hero-flex {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }
  .about-profile-pic {
    margin-bottom: 12px;
  }
  .about-hero-text {
    max-width: 100%;
  }
}

/* Hamburger styles */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  width: 32px;
  height: 28px;
  justify-content: space-between;
  margin-left: auto;
  z-index: 200;
}

.hamburger span {
  display: block;
  height: 4px;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s;
}

/* Responsive nav for mobile */
@media (max-width: 900px) {
  nav {
    position: relative;
  }
  nav ul {
    display: none;
    flex-direction: column;
    background: #000;
    position: fixed;
    top: 70px; /* Adjust to your nav height */
    right: 0;
    width: 28vw;
    min-width: 180px;
    max-width: 320px;
    text-align: left;
    z-index: 150;
    padding: 0;
    margin: 0;
    border-left: 1px solid #222;
  }
  nav ul.active {
    display: flex;
  }
  nav ul li {
    width: 100%;
    margin: 0;
    border-bottom: 1px solid #222;
    padding: 18px 24px;
    box-sizing: border-box;
    background: #000;
  }
  .hamburger {
    display: flex;
  }
  nav ul.active #contact_link {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: #fff !important;
    box-shadow: none !important;
  }
}

/* Ensure the typewriter text stays on the same line */
#typewriter-text {
  font-size: 20px; /* Default font size for larger screens */
  /*font-family: "Courier New", Courier, monospace; */
  font-family: "Outfit-Light";
  /*font-weight: bold; */
  white-space: nowrap; /* Prevent wrapping onto the next line */
  overflow: hidden; /* Prevent overflow if the text is too long */
  text-overflow: ellipsis; /* Add ellipsis if the text overflows */
  display: inline-block; /* Ensure it behaves like inline text */
}

/* Style the em dash to align properly with the typewriter text */
#typewriter-dash {
  font-size: 17px; /* Match the font size of the typewriter text */
  /*font-family: "Courier New", Courier, monospace; */
  font-family: "Outfit-Light";
  /*font-weight: bold;*/
  position: relative; /* Allow precise positioning */
  top: -8px; /* Raise the dash higher */
  margin-right: 10px; /* Add spacing between the dash and the typewriter text */
  display: inline-block; /* Ensure it behaves like inline text */
}

/* Adjust the typewriter text for smaller screens */
@media (max-width: 768px) {
  #typewriter-text {
    font-size: 15px; /* Reduce font size for smaller screens */
  }
}

@media (max-width: 480px) {
  #typewriter-text {
    font-size: 13px; /* Further reduce font size for very small screens */
  }
}

#typewriter-text::after {
    content: "|";
    display: inline-block;
    margin-left: 2px;
    animation: blink-cursor 1.2s steps(1) infinite;
    /*font-weight: bold;*/
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.bimaristan-hero-flex {
  display: flex;
  align-items: flex-start;
  margin-bottom: 40px; /* Slightly reduced space below hero section */
  margin-top: 32px;    /* Slightly reduced space above hero section */
  padding-top: 16px;   /* Slightly reduced padding */
}

.bimaristan-hero-text-col {
  flex: 0 1 420px;
  min-width: 320px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 6px; /* Slightly lower the vertical gap between hero text elements */
}

.bimaristan-hero-img-col {
  flex: 1 1 0; /* Allow image column to take all remaining space */
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 4vw; /* Always 4% from the right */
  min-width: 0;
}

.bimaristan-hero-img-col img.case-study-image {
  width: 100%;
  height: auto;
  max-width: 100vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

@media (min-width: 1200px) {
  .bimaristan-hero-flex {
    gap: 2vw; /* Even smaller gap on very large screens */
  }
}

@media (max-width: 900px) {
  .bimaristan-hero-flex {
    flex-direction: column;
    gap: 32px;
    margin-top: 24px;
    margin-bottom: 32px;
  }
  .bimaristan-hero-img-col,
  .bimaristan-hero-text-col {
    max-width: 100%;
  }
  .bimaristan-hero-img-col img.case-study-image {
    max-width: 90vw;
    max-height: 40vh;
  }
}

.typewriter-chinese {
    font-size: 90%;
    vertical-align: middle;
}

.scroll-down-arrow {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 32px;
  margin-bottom: 12px;
  height: 40px;
  pointer-events: none;
  transition: opacity 0.4s;
}

.scroll-down-arrow span {
  display: block;
  width: 28px;
  height: 28px;
  border-bottom: 4px solid #222;
  border-right: 4px solid #222;
  transform: rotate(45deg) translateY(-20px);
  animation: bounce-arrow 1.2s infinite;
  opacity: 0.7;
}

@keyframes bounce-arrow {
  0%, 100% {
    transform: translateY(-20px) rotate(45deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-4px) rotate(45deg);
    opacity: 1;
  }
}

/* --- Add this at the end of your CSS file --- */
@media (max-width: 700px) {
  /* Show typewriter text below navbar */
  #typewriter-text {
    display: block !important;
    position: static;
    margin: 24px 0 0 0;
    text-align: left;      /* Keep left justified */
    width: 100%;
    z-index: 10;
  }

  /* Make sure the header text is above the background image and left justified */
  .header-text {
    position: relative;
    z-index: 3;
    margin-top: 0;
    margin-bottom: 24px;
    text-align: left;      /* Keep left justified */
    background: none !important;
    padding: 8px 0;
  }

  /* Adjust logo for mobile */
  .logo {
    width: 180px;
  }

  /* Keep nav bar the same height as before */
  .container {
    padding: 35px 4%;     /* Match original desktop padding */
    background-color: #000;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
  }
  nav {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

/* Add this at the end of your CSS file */
@media (max-height: 800px) {
  #typewriter-text {
    margin-top: 80px !important; /* Increase this value if needed to clear the nav bar */
  }
  .header-text {
    margin-top: 20px !important; /* Move header text further down if needed */
  }
  .container2 {
    align-items: flex-start !important; /* Allow header text to move down */
    padding-bottom: 0 !important;      /* Remove forced spacing at the bottom */
    height: auto !important;           /* Allow container to grow as needed */
    min-height: 0 !important;
  }
}

/* Improved fix for short desktop screens: ensure typewriter text is fully visible */
@media (max-height: 800px) and (min-width: 701px) {
  .container2 {
    height: auto !important;
    min-height: 0 !important;
    padding-top: 140px !important;      /* Increase top padding to push content below nav */
    padding-bottom: 24px !important;
    align-items: flex-start !important;
    background-position: top center;
    box-sizing: border-box;
  }
  .header-text {
    margin-top: 0 !important;
    margin-bottom: 16px !important;
  }
  #typewriter-text {
    margin-top: 0 !important;
    position: relative !important;
    z-index: 10;
    display: block !important;
  }
}

/* Adjust styles for mobile screens */
@media (max-width: 768px) {
  /* Center the work-list grid and ensure it fits within the screen */
  .work-list {
    grid-template-columns: 1fr; /* Make each work item take up the full width */
    padding: 0 16px; /* Add padding to prevent content from touching the edges */
  }

  /* Center the work items */
  .work {
    margin: 0 auto; /* Center the work items horizontally */
    width: 100%; /* Ensure the work items fit within the screen */
  }

  /* Ensure images inside work items are responsive */
  .work img {
    width: 100%; /* Make images take up the full width of their container */
    height: auto; /* Maintain aspect ratio */
  }

  /* Adjust the popup thumbnails for mobile */
  .popup-thumbnails {
    justify-content: center; /* Center the thumbnails */
    gap: 4px; /* Reduce the gap between thumbnails */
  }

  .popup-thumbnails img {
    height: 70px; /* Reduce the size of thumbnails for mobile */
  }

  /* Adjust the popup main image for mobile */
  .popup-main-image img {
    max-height: 70vh; /* Reduce the height of the main image */
    width: auto; /* Maintain aspect ratio */
  }

  /* Adjust the header text for mobile */
  .header-text {
    text-align: center; /* Center the header text */
    padding: 16px; /* Add padding for better spacing */
  }

  /* Adjust the footer for mobile */
  .footer {
    text-align: center; /* Center the footer text */
    padding: 20px; /* Add padding for better spacing */
  }

  /* Ensure the container2 background image is responsive */
  .container2 {
    height: auto; /* Allow the container to grow as needed */
    padding: 16px; /* Add padding for better spacing */
    background-size: cover; /* Ensure the background image scales properly */
  }

  /* Adjust the navigation menu for mobile */
  nav ul {
    padding: 0;
    margin: 0;
    text-align: center; /* Center the navigation links */
  }

  nav ul li {
    margin: 8px 0; /* Add spacing between navigation links */
  }

  /* Adjust the popup gallery for mobile */
  .popup-gallery {
    padding: 16px; /* Add padding to prevent content from touching the edges */
    width: 100%; /* Ensure the popup gallery spans the full width */
    height: auto; /* Allow the height to adjust dynamically */
    max-height: 90vh; /* Prevent the popup from exceeding the viewport height */
    overflow-y: auto; /* Add vertical scrolling if content overflows */
  }

  .popup-main-image img {
    max-height: 60vh; /* Reduce the height of the main image for mobile */
    width: auto; /* Maintain aspect ratio */
    margin: 0 auto; /* Center the image */
    display: block;
  }

  .popup-thumbnails {
    justify-content: center; /* Center the thumbnails */
    gap: 8px; /* Add spacing between thumbnails */
    padding: 8px; /* Add padding around thumbnails */
    overflow-x: auto; /* Allow horizontal scrolling for thumbnails */
  }

  .popup-thumbnails img {
    height: 60px; /* Reduce the size of thumbnails for mobile */
    width: auto; /* Maintain aspect ratio */
    cursor: pointer;
    border-radius: 0; /* Keep thumbnails square or rectangular */
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .popup-thumbnails img:hover {
    transform: scale(1.1); /* Slightly enlarge the thumbnail on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5); /* Black shadow on hover */
  }

  #close-portfolio-popup {
    top: 16px; /* Adjust the distance from the top */
    right: 16px; /* Adjust the distance from the right */
    font-size: 36px; /* Reduce the size of the "x" button for mobile */
  }

  /* Center the typewriter text in the header */
  #typewriter-text {
    text-align: center; /* Center the text */
    margin: 16px auto; /* Add margin to center it vertically */
    width: 100%; /* Ensure it spans the full width */
  }

  /* Adjust margins for images/layers */
  .work-list {
    padding: 0 2%; /* Reduce the left/right padding to 2% */
  }

  .work {
    margin: 0 auto; /* Center the work items horizontally */
    width: 96%; /* Ensure the work items fit within the screen with 2% margins */
  }

  /* Adjust overlay text for mobile screens */
  .layer h3 {
    font-size: 16px; /* Reduce the font size of the title */
    line-height: 1.2; /* Adjust line height for better spacing */
  }

  .layer p {
    font-size: 12px; /* Reduce the font size of the description */
    line-height: 1.4; /* Adjust line height for better readability */
  }

  .layer {
    padding: 8px; /* Add padding to ensure text doesn't touch the edges */
  }

  /* Adjust overlay text for the top three images on mobile screens */
  .layer-case h3 {
    font-size: 16px; /* Reduce the font size of the title */
    line-height: 1.2; /* Adjust line height for better spacing */
  }

  .layer-case p {
    font-size: 12px; /* Reduce the font size of the description */
    line-height: 1.4; /* Adjust line height for better readability */
  }

  .layer-case {
    padding: 8px; /* Add padding to ensure text doesn't touch the edges */
  }

  /* Adjust "Portfolio." alignment for mobile screens */
  .container3 h1.sub-title {
    margin-left: 4%; /* Add margin to move it away from the left edge */
    text-align: left; /* Ensure the text remains left-aligned */
  }
}

/* Responsive popup styles for mobile screens */
@media (max-width: 768px) {
  .popup-main-image img {
    max-width: 90%; /* Limit the width to 90% of the viewport */
    max-height: 60vh; /* Limit the height to 60% of the viewport */
    object-fit: contain; /* Ensure the image fits within the container */
  }

  .popup-thumbnails img {
    height: 60px; /* Reduce thumbnail size for smaller screens */
  }

  .popup-gallery {
    padding: 10px; /* Add padding around the popup for better spacing */
  }
}

/* Ensure the typewriter text is always below the navbar on mobile screens */
@media (max-width: 768px) {
  #typewriter-text {
    position: relative; /* Ensure it is positioned relative to the flow of the document */
    margin-top: 40px; /* Add enough margin to push it below the navbar */
    text-align: center; /* Center the text */
    z-index: 1; /* Ensure it is above other elements */
    width: 100%; /* Ensure it spans the full width */
  }

  /* Adjust the navbar to ensure proper spacing */
  .container {
    padding: 20px 4%; /* Reduce padding to make space for the typewriter text */
  }
}

/* Raise the header text for mobile screens */
@media (max-width: 768px) and (max-height: 800px) {
  .container2 {
    align-items: flex-start; /* Move the header text closer to the top */
    padding-top: 0px; /* Add padding to position the text higher */
    height: auto; /* Allow the container to adjust its height dynamically */
  }

  .header-text {
    margin-top: 0; /* Remove any extra margin above the header text */
    padding: 0 16px; /* Add some horizontal padding for better spacing */
    text-align: center; /* Center the text for mobile screens */
  }

  #typewriter-text {
    margin-top: 16px; /* Add some space below the navbar */
    font-size: 20px; /* Adjust font size for smaller screens */
  }

  .header-text h1 {
    font-size: 35px; /* Reduce the font size of the main header text */
    line-height: 1.2; /* Adjust line height for better spacing */
    margin-bottom: 40px;
  }
}

.case-study ul li {
    font-family: 'Outfit', 'Outfit-Regular', sans-serif;
    font-size: 18px;
    font-weight: normal;
    line-height: 1.4;
}

.green-dot {
    color: #00C47C; /* Use the same green as "Raymond" */
}

/* Increase space after each item in tri-column2 */
.case-study .tri-column2 p > span {
    display: inline-block;
    margin-bottom: 0.4em; /* Increase this value for more space */
}

.case-study ul {
    margin-left: 2em; /* Adjust the value as needed for more or less indentation */
}

.case-study p + ul {
    margin-top: 0.2em; /* Reduce this value for less space */
}

