/* Minimal reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Playfair Display", -apple-system, BlinkMacSystemFont, "Segoe UI", serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #e7e7e7;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

img {
  height: auto;
  display: block;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout: header top-left, projects viewport center, about right-bottom */
body {
  padding: 2%;
  height: 100vh;
}

main {
  padding: 1%;
  display: flex;  
  flex-direction: column;
  justify-content: space-between;
}

.hero h1 {
  margin:0;
  font-size: clamp(1.5rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0;
  font-size: 1.125rem;
  color: #555;
}

.projects {
  display: flex;
  /* flex-direction: column; */
  align-items: start;
  justify-content: center;
  gap: 1.5rem;
}

.projects-inner {
  display: contents;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 23rem;
}

.project-card:hover {
  border-color: #c4c4c4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.project-card-description {
  display: block;
  padding: 1rem 1rem 0 1rem;
  font-size: 0.875rem;
  color: #444;
  font-style: italic;
}

.project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  overflow: auto;
}

.project-card-link:hover {
  text-decoration: none;
}

.project-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%);
}

.project-card-title {
  display: block;
  padding: 1rem 1rem 0 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.project-card:hover .project-card-title {
  color: #2563eb;
}

.project-card-stack {
  margin: 0;
  padding: 1rem;
  font-size: 0.8125rem;
  color: #666;
}

.project-card-social {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #eee;
}

.project-card-social a {
  color: #666;
  transition: color 0.2s;
}

.project-card-social a:hover {
  color: #2563eb;
  text-decoration: none;
}

.project-card-social .icon {
  width: 20px;
  height: 20px;
}

/* Projects toggle button — hidden on desktop, shown on mobile */
.projects-toggle {
  display: none;
}

.resume-link {
  display: inline-block;
  font-size: 0.9375rem;
  color: #252525;
}

.resume-link:hover {
  color: #2563eb;
}

.hero-about-divider {
  display: none;
}

/* About */

.about h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.about p {
  margin: 0;
  color: #444;
  font-size: 1.2rem;
}

/* Footer / social */
.social {
  margin-top: auto;
  padding-top: 0.7rem;
  display: flex;
  gap: 1.25rem;
}

.social a {
  color: #666;
  transition: color 0.2s;
}

.social a:hover {
  color: #2563eb;
  text-decoration: none;
}

.icon {
  width: 24px;
  height: 24px;
}

/* Project page: back link */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  color: #666;
}

.back-link:hover {
  color: #2563eb;
}

/* Project page: detail section */
.project-detail {
  margin-top: 0;
}

.project-detail-image {
  aspect-ratio: 16 / 9;
  max-width: 100%;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%);
  border-radius: 8px;
}

.project-detail p {
  margin: 0 0 1rem;
  color: #444;
}

.project-detail p:last-child {
  margin-bottom: 0;
}

/* Mobile: projects overlay and toggle button */
@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  main {
    justify-content: flex-start;
  }

  .hero-about-divider {
    display: block;
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid #ccc;
  }

  .projects-toggle {
    display: block;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 98;
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
  }

  .projects-toggle:hover {
    border-color: #c4c4c4;
    color: #2563eb;
  }

  .projects {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
    align-items: stretch;
    justify-content: flex-start;
  }

  body.projects-open {
    overflow: hidden;
  }

  body.projects-open .projects {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.projects-open .projects-toggle {
    visibility: hidden;
  }

  .projects-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 101;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.75rem;
    line-height: 1;
    color: #666;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .projects-close:hover {
    color: #1a1a1a;
    border-color: #c4c4c4;
  }

  .projects-inner {
    max-width: 23rem;
    margin: 3rem auto 2rem;
    background: #e7e7e7;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .projects .project-card {
    width: 100%;
  }
}

@media (min-width: 1100px) {
  .projects-close {
    display: none;
  }
}

