/* Color Variables */
:root {
  --background: #efefef;
  --text-light: #999999;
  --text-dark: #222222;
  --accent-color: #59A5FF;
}

/* CSS Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--background);
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 50px 20px 50px; /* Changed top padding from 20px to 0 */
  
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden; 
}

/* Header Section with Full-Width Line */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  width: 100%;
  padding-top: 20px;
  padding-bottom: 20px;
  background-color: var(--background); /* Prevents scrolled content from showing behind title/buttons */
  margin-bottom: 5px;
}

.header-line {
  position: absolute;
  top: 50%;
  /* Break out of max-width container to span full viewport */
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  height: 2px;
  background-color: var(--accent-color);
  z-index: 1;
}

.title {
  position: relative;
  z-index: 2;
  background-color: var(--background);
  padding: 0 15px;
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.22em;
}

.title a {
  color: var(--text-light);
  text-decoration: none; /* Removes default hyperlink underline */
  cursor: pointer;      /* Changes cursor to finger pointer */
  transition: color 0.3s ease;
}

.title a:hover {
  color: var(--accent-color);
}

.nav-buttons {
  position: relative;
  z-index: 2;
  margin-left: auto;
  display: flex;
  gap: 50px;
}

/* Pill Button Styling */
.btn {
  background-color: var(--background);
  border: 2px solid var(--text-light);
  color: var(--text-light);
  padding: 3px 18px;
  border-radius: 20px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--background);
}

/* Main Content Column */
main {
  flex: 1;
  width: 100%;
  max-width: 700px;
  transition: max-width 0.6s ease;
}

main.has-expanded {
  max-width: 100%; /* Expands main container width when a card opens */
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

/* Collapsed Card Styles */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
  scroll-margin-top: 85px;
}


.card-close-btn {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  z-index: 20;
  transition: color 0.2s ease;
  padding: 4px 8px;
}

.card-close-btn:hover {
  color: var(--accent-color);
}

/* Reveal Close Button only when card is expanded */
.project-card.expanded .card-close-btn {
  display: block;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-light);
  transition: color 0.3s ease;
}

.card-content {
  display: flex;
  gap: 30px;
  width: 100%;
}

.image-container {
  width: 100%;
  max-width: 700px;
  height: 250px;
  background-color: var(--accent-color);
  overflow: hidden;
  transition: all 0.6s ease;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.65;
  transition: opacity 0.3s ease;
}

/* Hidden Description State */
.project-description {
  display: none;
  opacity: 0;
  flex: 1;
  color: var(--text-dark);
  transition: opacity 0.6s ease;
  overflow-y: auto;
}

/* Hover Transitions for Collapsed Cards */
.project-card:not(.expanded):hover .project-title {
  color: var(--accent-color);
}

.project-card:not(.expanded):hover .project-image {
  opacity: 1;
}

.project-card:not(.expanded):hover .media-container,
.project-card:not(.expanded):hover .image-container {
  overflow: visible; /* Temporarily allows the shadow to show outside the container */
   transform: translateY(-2px); 
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}


/* Expanded Card State */
.project-card.expanded {
  width: 100%;
}

.project-card.expanded .project-title {
  display: none;
}

.project-card.expanded .image-container {
  height: 60vh;
  max-width: 60%; /* Image takes up left side of expanded view */
}

.project-card.expanded .project-description {
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Aligns content to the bottom */
  gap: 12px;
  opacity: 1;
  height: 60vh;
  padding: 10px 0;
}

.project-description h3 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-dark);
}

.project-description p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-dark);
}

.media-column {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  transition: all 0.6s ease;
}

/* Expanded State for Media Container */
.project-card.expanded .media-column {
  max-width: 60%;
}

.media-container {
  width: 100%;
  height: 250px;
  background-color: var(--accent-color);
  overflow: hidden;
  position: relative;
  transition: all 0.6s ease;
}

/* Toggle Preview Image vs Carousel */
.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card.expanded .preview-image {
  display: none; /* Hide preview image when card opens */
}

.project-card.expanded .media-container {
  height: 70vh;
  max-width: 100%;
  background-color: var(--background); /* Or #ffffff for crisp white */
}

.carousel {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

.project-card.expanded .carousel {
  display: flex;
}

.project-card.expanded .carousel-controls {
  display: flex;
}

/* Slide Container & Images */
.carousel-slides {
  width: 100%;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

.slide.active {
  opacity: 1 !important; /* Forces image to be visible over accent background */
}

.carousel-captions {
  display: none;
  position: relative;
  width: 100%;
  padding-top: 14px;
  min-height: 55px; /* Reserve height so controls don't jump around when text length changes */
  text-align: center;
}

.project-card.expanded .carousel-captions {
  display: block;
}

/* Caption Text Formatting */
.caption {
  display: none;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-dark);
  transition: opacity 0.3s ease;
}

.caption.active {
  display: block;
}


/* Arrow Navigation Buttons */

.carousel-controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px; /* Distance between < and > buttons */
  padding-top: 12px;
  width: 100%;
  background: transparent;
}

.carousel-btn {
  background: var(--background);
  color: var(--text-light);
  border: 2px solid var(--text-light);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.carousel-btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--background);
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

/* Dot Indicators */

.project-card:hover .project-title {
  color: var(--accent-color);
}

.project-card:hover .project-image {
  opacity: 0.6; /* Adjust between 0.2 and 0.6 to control how strongly the color shows through */
}

.project-card.expanded:hover .project-image {
  opacity: 1;
}

/* Smooth transition for non-hovered state */
.project-image,
.project-title {
  transition: all 0.3s ease;
}

/* Footer Section */
/* Footer Container */
footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 40px;
  padding-bottom: 30px;
}

.archive-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Button Active State */
.btn.active {
  background-color: var(--accent-color);
  color: var(--background);
  border-color: var(--accent-color);
}

/* Hidden Utility Class */
.hidden {
  display: none !important;
}

/* Archive Text Box List */
.archive-box {
  background-color: var(--background);
  text-align: right;
  padding: 16px 20px;
  min-width: 260px;
}


/* Slide-In Overlay Panel */
/* Slide-In Overlay Panel (Positioned Below Header) */
/* Base State (Controls the SLIDE-OUT / CLOSING speed) */
.about-overlay {
  position: fixed;
  top: 80px;
  right: -100vw;
  width: 100vw;
  height: calc(100vh - 80px);
  background-color: var(--background);
  z-index: 90;
  
  /* SLIDE-OUT SPEED (e.g. 1.2s for a slow close) */
  transition: right 0.8s ease-in-out; 
  
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow-y: auto;
}

.about-overlay a {
  color: var(--text-light);
  text-decoration: none; /* Removes default hyperlink underline */
  cursor: pointer;      /* Changes cursor to finger pointer */
  transition: color 0.3s ease;
}

.about-overlay a:hover{
  color: var(--accent-color);
}

/* Active State (Controls the SLIDE-IN / OPENING speed) */
.about-overlay.open {
  right: 0;
  
  /* SLIDE-IN SPEED (e.g. 0.4s for a fast open) */
  transition: right 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Panel Layout: Image Left, Text Right */
.about-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 60px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.about-image-col {
  flex: 1;
  max-width: 500px;
}

.about-image {
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
}

.about-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text-dark);
}

.about-text-col p {
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 30px;
  right: 50px;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  transition: color 1s ease;
}

.close-btn:hover {
  color: var(--accent-color);
}


/* Lightbox Overlay (Hidden by Default) */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(239, 239, 239, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.open {
  display: flex;
}

/* Lightbox Image Container */
.lightbox-content {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.lightbox-caption {
  color: var(--text-dark);
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.4;
}

/* Lightbox Controls */
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 36px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 3rem;
  cursor: pointer;
  line-height: 1;
  z-index: 1010;
  transition: opacity 0.2s ease;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--background);
  color: var(--text-light);
  border: 2px solid var(--text-light);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1010;
  transition: background 0.2s ease;
}

.lightbox-btn:hover {
  background: var(--accent-color);
  color: var(--background);
  border-color: var(--accent-color);
}

.lightbox-close:hover {
  color: var(--accent-color);
}

.lightbox-btn.prev { left: 30px; }
.lightbox-btn.next { right: 30px; }

.archive-item {
  cursor: pointer;
  transition: color 0.2s ease;
}

.archive-item:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Archive Modal Overlay */
.archive-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  pointer-events: auto; /* Ensures overlay intercepts clicks to close */
}

.archive-modal.open {
  display: flex;
}

/* Modal Content Box */
.archive-modal-content {
  position: relative;
  background-color: var(--background);
  width: 90vw;
  max-width: 1500px;
  height: 85vh;
  padding: 40px 30px 30px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.archive-modal-title {
  color: var(--text-dark);
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  text-align: center;
}

.archive-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
  z-index: 10;
}

.archive-modal-close:hover {
  color: var(--accent-color);
}

/* Vertically Scrollable Image Body */
.archive-modal-body {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding-right: 10px; /* Offset for custom scrollbar spacing */
}

.archive-modal-body img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.archive-section-header {
  color: var(--text-dark);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-top: 25px;
  margin-bottom: 5px;
  text-align: center;
  width: 100%;
}

.archive-section-header:first-child {
  margin-top: 0;
}

/* Responsive adjustment for small screens */
/* Mobile Responsive Styles */
/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Page Padding */
  body {
    padding: 0 20px 20px 20px;
  }

  /* 1. Center Header Title */
header {
    position: sticky;
    top: 0;
    z-index: 100; /* Keeps header layered above project cards */
    background-color: var(--background); /* Prevents content from showing through */
    
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 15px;
    padding-bottom: 15px;
  }

  .title {
    text-align: center;
    padding: 0 10px;
	font-weight:400;
  }

  /* Hide Nav Container Layout Restrictions & Hide Color Button */
  .nav-buttons {
    margin-left: 0;
  }

  #colorBtn {
    display: none !important;
  }

  /* 2. Position About Button Fixed in Bottom Right Corner */
  #aboutBtn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 200; /* Keeps it floating above project cards & main content */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  /* 3. About Overlay Opens From Bottom */
 .about-overlay {
  top: auto;
  bottom: -100vh;
  right: 0;
  left: 0;
  width: 100vw;
  /* Increase height to 92vh so it sits higher up on screen */
  height: 90vh; 
  transition: bottom 0.8s ease-in-out;
  
  /* Align content toward the top instead of centering vertically */
  align-items: flex-start; 
  padding-top: 80px; /* Space for the close button */
  }

  .about-overlay.open {
    bottom: 0;
    right: 0;
    transition: bottom 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

.about-content {
  flex-direction: column;
  gap: 25px;
  padding-bottom: 40px; /* Prevents last text lines from clipping at screen bottom */
	}
.about-image-col {
    max-width: 100%;
    width: 100%;
  }

  .about-image {
    width: 100%;
    aspect-ratio: 16 / 9; /* Changes aspect ratio from 4/5 portrait to landscape */
    max-height: 220px;    /* Prevents the image from consuming too much vertical room */
    object-fit: cover;
  }

  /* 4. Center Project Cards */
  main {
    max-width: 100%;
    margin: 0 auto;
  }

  .project-list {
    align-items: center;
  }

  .project-card {
    width: 100%;
    max-width: 500px;
  }

  /* 5. Expanded Project Card: Media Column on Top, Description Underneath */
  .project-card.expanded .card-content {
    flex-direction: column;
    gap: 20px;
  }

  .project-card.expanded .media-column {
    max-width: 100%;
    width: 100%;
  }

  .project-card.expanded .media-container {
    height: 45vh;
    max-width: 100%;
  }

  .project-card.expanded .project-description {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    padding: 0;
  }
  
  .media-container img {
    pointer-events: none !important;
  }
  
  footer {
  padding-bottom: 80px;
}
}