/* ==========================================================================
   Portfolio — Stylesheet
   ========================================================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background-color: #F9F9F9;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Layout Helpers --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation --- */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0px;
  max-width: 1100px;
  margin: 0 auto;
}

.site-nav .logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-nav .nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.site-nav .nav-links a {
  font-size: 0.9rem;
  font-weight: 400;
  transition: opacity 0.2s ease;
}

.site-nav .nav-links a:hover {
  opacity: 0.55;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1a1a1a;
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Hero Section --- */
.hero {
  padding: 100px 0 80px;
  text-align: left;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 700px;
  letter-spacing: -0.02em;
}

.hero p {
  margin-top: 20px;
  font-size: 1.15rem;
  color: #555;
  max-width: 550px;
  line-height: 1.5;
}

/* --- Project Grid (Homepage) --- */
.projects-section {
  padding: 20px 0 100px;
}

.projects-section h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin-bottom: 36px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.project-card {
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
}

.project-card .thumbnail {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
}

.project-card .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card .thumbnail svg {
  width: 100%;
  height: 100%;
}

.project-card h3 {
  margin-top: 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.project-card p {
  margin-top: 6px;
  font-size: 0.92rem;
  color: #666;
  line-height: 1.45;
}

/* --- Project Detail Page --- */
.project-detail {
  padding: 60px 0 100px;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline; /* Aligns the 'feet' of the text */
  margin-bottom: 40px;
}

.project-nav a {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  line-height: 1; /* Forces the box to wrap tightly around the text */
  color: #666;
  text-decoration: none; /* Good practice to ensure no bottom border adds height */
}

.project-nav a:hover {
  color: #1a1a1a;
}

.project-nav .next-link {
  flex-direction: row-reverse;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 40px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #1a1a1a;
}

.project-detail h1 {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 32px;
}

.project-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}

.project-info-four {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
  margin-top: 60px;
}

.project-info-aside {
  display: grid;
  grid-template-columns: 0.3fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}

.project-info-three {
  display: grid;
  grid-template-columns: 0.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
  border: 1px solid #000;
  border-radius: 4px;
  padding: 70px;
}

.project-results {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
  border: 1px solid #000;
  border-radius: 4px;
  padding: 40px;
}

.project-results > div:first-child h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #404040;
  margin-bottom: 12px;
}

.project-results > div:first-child p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #555;
}

.project-results .result-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: #000;
  /* margin-bottom: 12px; */
}

.project-results > div:not(:first-child) p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
}

.project-info-four-bordered {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 60px;
}

.project-info-four-bordered > div {
  border: 1px solid #000;
  border-radius: 4px;
  padding: 20px;
}

.project-info h2, .project-info-four h2, .project-info-aside h2, .project-info-three h2, .project-info-four-bordered h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #404040;
  margin-bottom: 12px;
}

.project-info-three h3, .project-info-four-bordered h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #404040;
  margin-bottom: 12px;
}

.project-info-three ul, .project-info-four-bordered ul {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}

.project-info-three li{
  font-size: 1rem;
  line-height: 1.65;
  color: #444;
  margin-bottom: 8px;
}

.project-info-four-bordered li {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #444;
  margin-bottom: 5px;
}

.project-info-four-bordered p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #444;
}

.project-info p, .project-info-four p, .project-info-aside p, .project-info-three p {
  font-size: 1rem;
  line-height: 1.65;
  color: #444;
}

.project-gallery h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin-bottom: 24px;
}

.project-gallery .gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 70px;
}

.project-gallery .gallery-grid .gallery-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  overflow: hidden;
}

.project-gallery .gallery-grid .gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-gallery .gallery-grid .gallery-image svg {
  width: 100%;
  height: 100%;
}

.header-image {
  margin-bottom: 70px;
}

.gallery-two-square {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.gallery-two-square .square-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  overflow: hidden;
}

.gallery-two-square .square-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-grid-four {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-bottom: 60px;
}

.project-grid-four div {
  text-align: left;
  background-color: #fff;
  /* border: 1px solid #e8e8e8; */
  border-radius: 4px;
  overflow: hidden;
}

.project-grid-four img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  margin-bottom: 16px;
}

.project-grid-four h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: #333;
  padding: 0 20px;
}

.project-grid-four h3:first-of-type {
  padding-top: 16px;
}

.project-grid-four p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #444;
  padding: 0 20px 20px 20px;
}


/* --- About Page --- */
.about-page {
  padding: 60px 0 100px;
}

.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 80px;
}

.about-portrait {
  border-radius: 4px;
  overflow: hidden;
  background-color: #e8e8e8;
}

.about-portrait img,
.about-portrait svg {
  width: 100%;
  height: auto;
  display: block;
}

.about-intro-text h1 {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.about-intro-text p {
  font-size: 1rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 16px;
}

.about-section {
  margin-bottom: 72px;
}

.about-section h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
}

.about-snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.about-snapshot-grid h2 {
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: none;
}

.about-snapshot-grid .career-entry {
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}

.about-snapshot-grid .career-entry:last-child {
  border-bottom: none;
}

/* Career Timeline */
.career-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.career-entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}

.career-entry:last-child {
  border-bottom: none;
}

.career-year {
  font-size: 0.85rem;
  color: #999;
  padding-top: 2px;
}

.career-entry h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.career-entry p {
  font-size: 0.92rem;
  color: #666;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.skill-group h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.skill-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags li {
  font-size: 0.85rem;
  padding: 6px 14px;
  background-color: #f5f5f5;
  border-radius: 20px;
  color: #444;
}

/* Hobbies */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.hobby-card {
  padding: 28px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  transition: border-color 0.2s ease;
}

.hobby-card:hover {
  border-color: #ccc;
}

.hobby-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 16px;
  color: #999;
}

.hobby-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hobby-card p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.55;
}

/* --- Contact Page --- */
.contact-page {
  padding: 80px 0 120px;
}

.contact-header {
  margin-bottom: 64px;
}

.contact-header h1 {
  font-size: 3.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.contact-subtitle {
  font-size: 1.15rem;
  line-height: 1.55;
  color: #555;
  max-width: 550px;
}

.contact-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.contact-detail-item h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin-bottom: 10px;
}

.contact-detail-item p {
  font-size: 1rem;
  line-height: 1.65;
  color: #444;
}

.contact-links h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin-bottom: 20px;
}

.contact-link-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-link {
  display: flex;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #e8e8e8;
  transition: padding-left 0.2s ease;
}

.contact-link:first-child {
  border-top: 1px solid #e8e8e8;
}

.contact-link:hover {
  padding-left: 8px;
}

.contact-link-label {
  font-size: 0.85rem;
  color: #999;
  width: 80px;
  flex-shrink: 0;
}

.contact-link-value {
  font-size: 1rem;
  font-weight: 500;
  flex: 1;
}

.contact-link-arrow {
  font-size: 1.1rem;
  color: #999;
  transition: transform 0.2s ease;
}

.contact-link:hover .contact-link-arrow {
  transform: translateX(4px);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid #e8e8e8;
  padding: 40px 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.85rem;
  color: #999;
}

.site-footer a {
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: #1a1a1a;
}

/* --- Fade-in Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay for project cards */
.project-card.fade-in:nth-child(2) { transition-delay: 0.1s; }
.project-card.fade-in:nth-child(3) { transition-delay: 0.2s; }
.project-card.fade-in:nth-child(4) { transition-delay: 0.3s; }

/* Stagger delay for gallery images */
.gallery-image.fade-in:nth-child(2) { transition-delay: 0.15s; }
.gallery-image.fade-in:nth-child(3) { transition-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 1170px) {
  .container {
    max-width: 100%;
    padding: 0 max(20px, 4vw);
  }

  .site-nav {
    max-width: 100%;
    padding: 28px max(20px, 4vw);
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: 60px;
    padding-bottom: 50px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .gallery-two-square {
    grid-template-columns: 1fr;
  }

  .project-nav {
    flex-direction: column;
    gap: 12px;
  }

  .project-nav a {
    justify-content: center;
  }

  .project-info {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-info-four {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-info-aside {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-info-three {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-results {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-info-four-bordered {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .about-snapshot-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-grid-four {
    grid-template-columns: 1fr;
  }

  /* Mobile nav */
  .nav-toggle {
    display: block;
    z-index: 10;
  }

  .site-nav .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    padding: 80px 32px;
    gap: 24px;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.08);
    transition: right 0.3s ease;
    z-index: 5;
  }

  .site-nav .nav-links.open {
    right: 0;
  }

  /* About page mobile */
  .about-intro {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .about-intro-text h1 {
    font-size: 2rem;
  }

  .career-entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hobbies-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Contact page mobile */
  .contact-header h1 {
    font-size: 2.4rem;
  }

  .contact-body {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}
