/* ============================================
   IMPORTS
   External resources loaded first
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap");


/* ============================================
   CSS RESET & NORMALIZATION
   Ensures consistent behavior across browsers
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 100vh;
}

ul {
  list-style: none;
}


/* ============================================
   BASE STYLES
   Default typography and layout
   ============================================ */

body {
  display: grid;
  place-items: center;
  min-height: 100%;
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
  background-color: var(--color-bg-dark);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ============================================
   MAIN HEADING
   Animated page title with typewriter effect
   ============================================ */

.main__heading {
  /* Layout */
  margin-top: 4%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  
  /* Typography */
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  
  /* Gradient text effect */
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  
  /* Typewriter effect setup */
  overflow: hidden;
  white-space: nowrap;
  border-right: 0.125rem solid #eceff1;
  width: 0;
  max-width: 10ch;
  
  /* Animations */
  animation:
    typing 2.5s steps(30, end) forwards,
    blink-caret 0.75s step-end 5 forwards;
}

@keyframes typing {
  from { 
    width: 0; 
  }
  to { 
    width: 30ch; 
  }
}

@keyframes blink-caret {
  from, to { 
    border-color: transparent; 
  }
  50% { 
    border-color: #eceff1; 
  }
  100% { 
    border-color: transparent; 
  }
}


/* ============================================
   PROJECTS PAGE
   Main projects section container
   ============================================ */

.projects-page {
  /* Layout */
  position: relative;
  width: 100%;
  padding: 5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  
  /* Typography */
  font-family: 'Montserrat', sans-serif;
  color: #ccc;
  
  /* Visual */
  background-color: transparent;
}

.projects-page h1 {
  /* Typography */
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5rem;
  text-align: center;
  color: var(--text-color);
  
  /* Spacing */
  margin-bottom: 2.5rem;
}


/* ============================================
   PROJECTS GRID
   Grid layout for project cards
   ============================================ */

.projects-grid {
  /* Layout */
  display: flex;
  flex-direction: column;
  gap: 1.875rem;
  max-width: 75rem;
  margin: 0 auto;
  padding: 1.25rem;
  
  /* Typography */
  font-family: 'Montserrat', sans-serif;
}


/* ============================================
   PROJECT CARD
   Individual project display card
   ============================================ */

.project-card {
  /* Layout */
  display: flex;
  gap: 1.875rem;
  padding: 1.875rem;
  
  /* Typography */
  font-family: 'Montserrat', sans-serif;
  
  /* Visual */
  background-color: var(--color-bg-dark);
  border: 0.0625rem solid var(--color-primary);
  border-radius: 0.9375rem;
  
  /* Animation */
  transition: 
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-0.625rem);
  box-shadow: 0 0.625rem 1.25rem var(--color-primary-dark);
  border-color: var(--color-primary);
}


/* ============================================
   PROJECT IMAGE
   Card thumbnail/preview image
   ============================================ */

.project-card img {
  width: 30%;
  height: auto;
  object-fit: cover;
  border-radius: 0.3125rem;
}


/* ============================================
   PROJECT CONTENT
   Card text content container
   ============================================ */

.project-content {
  /* Layout */
  flex: 1;
  display: flex;
  flex-direction: column;
  
  /* Typography */
  font-family: 'Montserrat', sans-serif;
}

.project-card h2 {
  /* Typography */
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  color: var(--color-primary);
  
  /* Spacing */
  margin-bottom: 0.9375rem;
}

.project-card p {
  /* Typography */
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  color: #d0d0d0;
  
  /* Spacing */
  margin-bottom: 1.25rem;
}


/* ============================================
   PROJECT TAGS
   Technology/category badges
   ============================================ */

.project-tags {
  /* Layout */
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0.9375rem 0;
  
  /* Typography */
  font-family: 'Montserrat', sans-serif;
}

.project-tags span {
  /* Layout */
  padding: 0.3125rem 0.625rem;
  
  /* Typography */
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  color: var(--text-color);
  
  /* Visual */
  background-color: var(--color-primary-darker);
  border-radius: 1.25rem;
}


/* ============================================
   PROJECT LINKS
   Action buttons/links
   ============================================ */

.project-card .project-links {
  /* Layout */
  display: flex;
  gap: 0.9375rem;
  margin-top: 1.25rem;
  
  /* Typography */
  font-family: 'Montserrat', sans-serif;
}

.project-card a {
  /* Layout */
  display: inline-block;
  padding: 0.625rem 1.25rem;
  
  /* Typography */
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
  color: var(--text-color);
  
  /* Visual */
  background-color: #1a1a1a;
  border: 0.0625rem solid var(--color-bg-darker);
  border-radius: 0.3125rem;
  
  /* Animation */
  transition: all 0.3s ease;
}

.project-card a:hover {
  background-color: var(--color-primary);
  color: #1a1a1a;
  box-shadow: 0 0 0.625rem rgba(100, 255, 218, 0.5);
}


/* ============================================
   RESPONSIVE DESIGN
   Tablet and mobile optimizations
   ============================================ */

/* Tablet: up to 1024px */
@media (max-width: 64rem) {
  .main__heading {
    margin-top: 5rem;
  }

  .project-card {
    align-items: center;
  }

  .project-card img {
    width: 100%;
    max-width: 12.5rem;
    height: auto;
  }

  .project-content {
    width: 100%;
  }
}

/* Mobile: up to 768px */
@media (max-width: 48rem) {
  .projects-page {
    padding: 3.75rem 0;
  }

  .projects-grid {
    padding: 1rem;
    gap: 1.25rem;
  }

  .project-card {
    flex-direction: column;
    align-items: center;
    font-size: 1rem;
    padding: 1.25rem;
  }

  .project-card h2 {
    font-size: 1.2rem;
    text-align: left;
  }

  .project-card img {
    display: block;
    width: 100%;
    max-width: 14.0625rem;
    height: auto;
    margin: 0.625rem auto;
  }

  .project-content {
    width: 100%;
  }

  .project-card .project-links {
    flex-direction: column;
  }

  .project-card a {
    text-align: center;
  }
}
