* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: #000;
  background: #fff;
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 20px;
}

/* Nav */
nav {
  background: #fff;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 10;
  transition: transform 0.3s ease; /* smooth hide/show */
}

nav.hide {
  transform: translateY(-100%); /* slides navbar up */
}


nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo a {
  font-weight: 700;
  text-decoration: none;
  color: #000;
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 30px;
}

nav ul li a {
  color: #000;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

nav ul li a::after {
  content: "";
  display: block;
  height: 2px;
  background: #000;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

nav ul li a:hover::after {
  transform: scaleX(1);
}

/* Minimalist Back button */
.back-btn {
  color:#000;
  font-weight:500;
  text-decoration:none;
  position:relative;
  display:inline-block;
}

.back-btn::before {
  content:"← Back"; /* all text + arrow */
  font-size:1rem;
  line-height:1;
  transition:transform .3s ease;
}

.back-btn::after {
  content:"";
  display:block;
  height:2px;
  background:#000;
  transform:scaleX(0);
  transition:transform .3s ease;
}

.back-btn:hover::after {
  transform:scaleX(1);
}

.back-btn:hover::before {
  transform:translateX(-3px);
}






/* Header */
.projects-header {
  padding: 80px 20px 40px;
  text-align: center;
}

.projects-header h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.projects-header p {
  font-size: 1.1rem;
  color: #333;
}

/* Grid: still 2 columns */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px; /* a bit smaller gap too */
  margin-top: 40px;
}

/* Cards smaller width */
.card {
  display: block;
  max-width: 70%;      /* don’t fill the whole cell */
  margin: 0 auto;      /* center it inside its cell */
  border: 1px solid #000;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

/* Slightly reduce inner paddings/text size */
.card h4 {
  padding: 10px 10px 0;
  font-weight: 500;
  font-size: 1rem; /* down from default */
}

.card p {
  padding: 0 10px 10px;
  font-size: 0.85rem; /* smaller */
}

.card img {
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
}


.card h4 {
  padding: 15px 15px 0;
  font-weight: 500;
}

.card p {
  padding: 0 15px 15px;
  font-size: 0.95rem;
  color: #333;
}

/* Hover effect */
.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card:hover img {
  transform: scale(1.05);
}

/* Active/press state */
.card:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Responsive: stack to 1 column on small screens */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr; /* one column on mobile */
  }
}






/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  right: -100%; /* start off screen */
  width: auto;  /* default width on small screens */
  max-width: 90%;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  transition: right 0.4s ease;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

@media (min-width: 800px) {
  .modal-overlay {
    width: 40%;
    max-width: none; /* optional: disables the 90% cap at large screens */
  }
}


/* Show modal */
.modal-overlay.active {
  right: 0; /* slide in */
}

/* Modal content */
.modal-content {
  position: relative;  /* allows .close to position relative to this */
}
.modal-content .close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 10;  /* ensures it's above the logo/images */
}
.modal-content img {
  width: 100%;
  margin-bottom: 15px;
  pointer-events: none; /* optional: prevents image from blocking clicks */
}

.modal-content h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

.modal-content p {
  font-size: 1rem;
  color: #333;
}

/* Close button */
.modal-content .close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
}

/* Optional: dark backdrop behind modal */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 900;
}

body.modal-open::after {
  opacity: 1;
  pointer-events: all;
}

/* Logo in modal – subtle shadow & crisp edges */
.modal-logo {
  width: 100px !important;  /* keep the size you want */
  height: auto !important;
  display: block;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  pointer-events: none; /* this stops blocking clicks */
}

.modal-tech {
  margin-top: 16px;
}

#modalTech {
  display: flex;
  flex-wrap: nowrap;           /* always one line */
  justify-content: center;
  align-items: center;
  gap: 4px;                    /* small gap */
}

#modalDesc,
#modalExplanation1,
#modalExplanation2 {
  text-align: justify;
}
#modalExplanation1,
#modalExplanation2 {
  margin-top: 0.75rem;
}


.modalTitle {
  text-align: center;                  /* small gap */
}

.tech-icon {
  flex-shrink: 1;              /* allow shrinking when space is tight */
  width: clamp(16px, 6vw, 30px); /* min 16px, max 30px, scales with viewport */
  height: auto;
  max-height: 30px;
  object-fit: contain;
}




/* Mockups container – equal spacing & center */
.modal-mockups {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0; /* no extra padding */
}

/* Each mockup – plain images */
.modal-mockups img {
  max-width: 100%;
  border-radius: 0;           /* no rounded corners */
  box-shadow: none;           /* no shadow */
  transition: none;           /* no hover effect */
}

.modal-mockups img:hover {
  transform: none;
  box-shadow: none;
}









/* Fade in */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer {
  margin-top: 5%;
  padding: 30px 20px;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
}
