:root {
  --bg-gradient: linear-gradient(to bottom right, #0d1118, #18212c, #253242);
  --text:       #e0e0e0;
  --accent:     #5aa9e6;
  --card-bg:    #1b1f24;
  --nav-bg:     #12161c;
  --nav-text:   #ffffff;
}

/* 1) Make html/body full-height and reset margins */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* 2) Body as flex column to support sticky footer */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-gradient);
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

/* 3) Wrapper holds header/main/footer and flexes */
.page-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* 4) Main grows to fill available space */
main {
  flex: 1 0 auto;
  padding: 100px 3rem 30px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
  background: transparent;
}

/* Header */
header {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 1.5rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Navigation */
nav {
  display: flex;
  gap: 1.8rem;
}
nav a {
  color: var(--nav-text);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  transition: color 0.3s ease;
}
nav a:hover {
  color: var(--accent);
}
nav a[aria-current="page"] {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.2rem;
}

/* Section Titles */
h2 {
  margin: 0 0 1rem;
  font-size: 1.9rem;
  font-weight: 500;
  text-align: left;
}

/* Sub-headings & paragraphs */
h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
p {
  font-size: 1rem;
  font-weight: 300;
  margin-bottom: 2rem;
}

/* CTA / project links */
.cta,
.project a {
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.cta:hover,
.project a:hover {
  text-decoration: underline;
}

/* Projects grid – two columns */
.project-grid {
  background: transparent;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}
.project-grid .project {
  background: var(--card-bg);
  padding: 0.65rem 2rem 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;              /* added */
  flex-direction: column;     /* added */
}
/* Push last odd card left */
body:not(.no-push) .project-grid .project:last-child:nth-child(odd) {
  grid-column: 1;
}
/* No-push override: full width 3rd card */
body.no-push .project-grid .project:nth-child(3) {
  grid-column: 1 / -1;
}

/* Nested pages grid */
.nested-project-grid {
  background: transparent;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
  gap: 2rem;
  margin-top: 2rem;
  justify-content: end;
}
.nested-project-grid .project {
  background: var(--card-bg);
  padding: 0.65rem 2rem 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  height: auto;
  display: flex;              /* added */
  flex-direction: column;     /* added */
}

/* Project footer */
.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;           /* changed from 1.5rem to auto */
}
.project-date {
  font-size: 0.85rem;
  color: #aaa;
}

/* Lists */
.highlights {
  list-style: none;
  padding-left: 0;
  margin: 2rem 0;
}
.highlights li {
  margin-bottom: 1rem;
  font-weight: 300;
  font-size: 1rem;
}

/* Contact buttons */
.contact-cards {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-top: 2rem;
}
.contact-card {
  background: var(--card-bg);
  color: var(--nav-text);
  padding: 1rem 2.5rem;
  min-width: 220px;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

/* Footer - always at the bottom, transparent */
footer {
  flex-shrink: 0;
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  font-size: 0.75rem;
  color: #999;
  font-weight: 300;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  position: relative;
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  main {
    padding: 80px 2.5rem 30px;
  }
  nav {
    gap: 1.2rem;
  }
  header {
    padding: 1.2rem 2rem;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .nested-project-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .project-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .contact-cards {
    flex-direction: column;
    gap: 2rem;
    align-items: stretch;
  }
  .contact-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    max-width: none;
  }
}
