/* Global styles */
body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #ffffff;
  color: #2b2b2b; /* much better readability on white */
 /* background-color: white;
  color: #c9d1d9;*/
  margin: 0;
  padding: 1rem 2rem 0 2rem;
  position: relative;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Lottie Animation */
#lottie {
  width: 250px;
  height: 250px;
  margin: 0 auto 0.1rem auto;
}

/* Corner Images */
.corner-img {
  position: fixed;
  width: 12vw;
  max-width: 135px;
  height: auto;
  object-fit: contain;
  z-index: 1000;
  pointer-events: none;
}

.top-left    { top: 0; left: 0; }
.top-right   { top: 0; right: 0; }
.bottom-left {
  bottom: 0;
  left: 0;
  transform: translateY(-0px); /* Fix for Edge */
}
.bottom-right {
  bottom: 0;
  right: 0;
  transform: translateY(-0px); /* Fix for Edge */
}

/* Header */
header {
  background-color: white;
  padding: 0.5rem 1rem 1rem 1rem;
  text-align: center;
  border-bottom: 1px solid #21262d;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}

header h1 {
  font-size: 1.75rem;
  color: #58a6ff;
  /*margin: 0.1rem 0 0 0;*/
  margin: -0.5rem 0 0 0; /* pull title upward */
  /*margin: 0;*/ /* ✅ total reset */
  line-height: 1;
}

/* Intro Text */
.intro-description {
  font-size: 1rem;
  color: #444444; /* more readable */
  margin-top: 1rem;
  line-height: 1.6;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

/* Projects Grid */
.projects-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1rem 0.4rem;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Project Card */
.project-card {
  background-color: #161b22;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
}

/* Project Image */
.project-link img {
  max-width: 220px;
  width: 100%;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-link img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.4);
}

/* Toggle Button */
.arrow-toggle {
  background: none;
  border: none;
  margin-top: 1rem;
  cursor: pointer;
  padding: 0.5rem;
}
.arrow-icon {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}
.arrow-rotated {
  transform: rotate(180deg);
}

/* Summary */
.summary {
  margin-top: 1rem;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  text-align: left;
  line-height: 1.5;
  color: #555555;
}
.summary.open {
  max-height: 300px;
  opacity: 1;
}

/* Footer Spacer */
.page-footer {
  height: 150px; /* Allows bottom corner images to display fully */
  flex-shrink: 0;
  background: transparent; /* Optional: just in case */
  border: none;
}

/* ===== MEDIA QUERIES ===== */

/* Tablet: 2 columns */
@media (max-width: 1200px) {
  .projects-container {
    grid-template-columns: repeat(2, 1fr);
    max-width: 550px;
  }

  header {
    max-width: 500px;
  }

  .corner-img {
    width: 100px;
  }

  body {
    padding-top: 1.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}


@media (max-width: 600px) {
  .corner-img {
    display: none;
  }
}

/* Mobile: 1 column */
@media (max-width: 800px) {
  #lottie {
    width: 200px;
    height: 200px;
    margin-bottom: 0.2rem;
  }

  header {
    max-width: 250px;
  }

  .projects-container {
    grid-template-columns: 1fr;
    max-width: 300px;
  }

  .corner-img {
    width: 90px;
  }

  body {
    padding-top: 1.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
