:root {
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;

  --radius: 1rem;
  --color-bg: #fff;
  --color-contrast: #f7f8fa;
  --color-primary: #000000;
  --color-accent: #e01948;
  --color-text: #000000;
  --font-base: 1rem;
  --font-lg: 1.25rem;
  --font-xl: 1.5rem;
}

/* GLOBAL STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  color: var(--color-text);
}

a {
  text-decoration: none;
  text-decoration-color: white;
  color: #333;
}

a:hover {
  color: grey;
  text-decoration: underline;
  text-underline-offset: 1rem;
  text-decoration-color: rgb(181, 181, 181);
  cursor: pointer;
}

ul {
  list-style: none;
}

p {
  color: rgb(85, 85, 85);
}

img {
  max-width: 100%;
}

/* LOADING ANIMATION */
.loading::after {
  content: "";
  animation: dots 1.75s steps(3, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  33% { content: "."; }
  66% { content: ".."; }
  100% { content: "..."; }
}

/* DESKTOP NAVIGATION */
nav,
.navbar {
  display: flex;
}

nav {
  justify-content: space-around;
  align-items: center;
  height: 17vh;
}

.navbar {
  gap: 2rem;
  list-style: none;
  font-size: 1.5rem;
}

.logo {
  font-size: 2rem;
}

.logo:hover {
  cursor: default;
}

/* PROFILE SECTION */

section {
  padding: var(--spacing-xl) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-sizing: border-box;
  min-height: fit-content;
  position: relative;
}

#profile {
  display: flex;
  justify-content: center;
  gap: 5rem;
  height: 80vh;
}

.section-pic-container {
  display: flex;
  border-radius: 10%;
  max-height: auto;
  max-width: auto;
  margin: auto 0;
}

.section-text {
  align-self: center;
  text-align: center;
}

.section-text p {
  font-weight: 400;
}

.section-text-p1 {
  text-align: center;
}
.section-text-p1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.section-text-p3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.section-text-p2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.section-text-p4 {
  text-align: center;
  font-size: 1.75rem;
  color: #f7f8fa;
}
.title {
  font-size: 3rem;
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.socials-container {
  display: flex;
  justify-content: center;
  margin-top: var(--spacing-sm);
  gap: var(--spacing-sm);
}

/* ICONS */
.contact-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
}

.contact-icon-link {
  display: block;
  width: 40px; /* adjust as needed */
  height: 40px;
}

.contact-icon-link:hover .contact-icon {
  transform: scale(1.2);
  cursor: pointer;
}

.icon {
  cursor: pointer;
  height: 3rem;
}

/* CONSOLIDATED BUTTON STYLES */
.btn-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 1rem;
  width: 10rem;
  border-radius: 2rem;
  text-decoration: none !important;
  display: inline-block;
  text-align: center;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none !important;
}

/* Primary dark button */
.btn-color-1 {
  background: rgb(53, 53, 53);
  color: white;
  border: rgb(53, 53, 53) 0.1rem solid;
}

.btn-color-1:hover {
  background: rgb(0, 0, 0);
  border: rgb(0, 0, 0) 0.1rem solid;
}

/* Outline button */
.btn-color-2 {
  background: none;
  color: rgb(53, 53, 53);
  border: rgb(53, 53, 53) 0.1rem solid;
}

.btn-color-2:hover {
  background: rgb(53, 53, 53);
  color: white;
  border: rgb(255, 255, 255) 0.1rem solid;
}


/* ABOUT SECTION */

#about {
  position: relative;
}
.text-container {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.section-text-p3 {
  font-size: 1.125rem; /* slightly larger body text */
  line-height: 1.6; /* more breathing room */
  color: #374151; /* softer dark for easier reading */
  text-align: justify; /* clean edges on both sides */
  margin-bottom: 1.5rem;
}

.text-pull-quote {
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.4;
  color: #1f2937;
  border-left: 4px solid #3b82f6;
  padding-left: 1rem;
  margin: 1.5rem 0;
  background: rgba(59, 130, 246, 0.05);
}

.about-container {
  gap: 2rem;
  margin-bottom: 7rem;
  margin-top: 0rem;
}

.about-detail-container {
  justify-content: center;
  flex-direction: column;
}

.about-container,
.about-detail-container {
  display: flex;
}

.about-pic {
  border-radius: 2rem;
  size: flex;
  max-height: auto;
  max-width: 100%;
}

.icon-arrow {
  position: absolute;
  right: -8rem;
  bottom: 0rem;
  margin-bottom: 0rem;
}

.detail-container {
  padding: 1.5rem;
  flex: 1;
  background: white;
  border-radius: 2rem;
  border: rgb(53, 53, 53) 0.1rem solid;
  border-color: rgb(163, 163, 163);
  text-align: center;
}

.section-container {
  gap: var(--spacing-xl);
  display: flex;
  margin-bottom: var(--spacing-lg);
}

.profile-pic-container {
  height: auto;
  width: 500px;
  margin: auto 0;
  border-radius: 3rem;
}

.section-pic-container {
  height: 400px;
  width: 400px;
  margin: auto 0;
}

/* Skills SECTION */

.skills-section {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  text-align: center;
}

.skills-section__title {
  font-size: 1rem;
  color: #555;
}

.skills-section__subtitle {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: #fff;
  border: 1px solid #e5e7eb; /* light gray border */
  border-radius: 1rem; /* rounded corners */
  padding: 1.5rem; /* inner spacing */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04); /* subtle lift */
  transition: transform 0.2s ease;
}

.skill-category:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.skill-category__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0;
  margin: 0;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
}

.skill-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.skill-item span {
  font-size: 0.9rem;
  font-weight: 500;
}

.skill-item small {
  font-size: 0.75rem;
  color: #777;
}

/* Responsive tweak */
@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* PROJECT SECTION */

.project-card {
  display: grid; /* use grid instead of flex for consistent rows */
  grid-template-rows: auto 1fr auto; /* header | content grows | footer fixed */
  height: 100%; /* allow equal-height stretching in the grid */
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  align-items: stretch; /* ensures equal height */
}

.project-card__image {
  /* choose your desired aspect ratio or fixed height */
  aspect-ratio: 16/9; /* keeps all images 16:9 */
  width: 100%;
  overflow: hidden;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* crop/scale to fill without distortion */
  display: block;
}

.project-card__header {
  padding: var(--spacing-md);
}

.project-card__title {
  font-size: var(--font-xl);
  color: var(--color-primary);
}

.project-card__summary {
  list-style: none;
  margin: 1rem 0 0; /* was 1rem 0 auto */
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card__summary li {
  display: grid;
  grid-template-columns: 150px 1fr; /* label | value */
  align-items: center; /* vertically center label */
  gap: 0.75rem;
}

.project-card__summary .label {
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  white-space: nowrap;
  text-align: center; /* keep value left-aligned below */
}

/* Keep values left-aligned and wrapping normally */
.project-card__summary .value {
  color: var(--color-text);
  text-align: left;
}

.label {
  font-weight: 700;
  text-transform: uppercase;
  text-align: center; /* centers label text in its column */
  color: #111827;
}

.value {
  color: #374151;
  text-align: left;
}
.bold {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.project-card__footer {
  align-self: end; /* pin to the bottom grid row */
  justify-self: center; /* center the footer horizontally within card */
  padding: var(--spacing-md);
  display: flex; /* button row */
  justify-content: center; /* center buttons */
  gap: 0.75rem;
  width: 100%; /* optional: full width footer for consistent look */
}

/* Disable hover effect on the footer’s button */
.project-card__footer .btn {
  /* Base styles */
  padding: 0.75rem 1.5rem; /* comfortable hit‑area */
  border-radius: 0.75rem; /* nice rounded corners */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-block; /* shrink‑wrap to content */
  text-align: center;
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
  margin-bottom: 2px;
  margin-top: 2px;
}

.project-card__footer .btn:hover {
  /* On hover, lift it up a bit and deepen the shadow */
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.project-card__footer .btn:active {
  /* On click, push it back down */
  transform: translateY(0) scale(1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns, equal width */
  gap: var(--spacing-lg); /* space between cards */
}

/* fallback: on really small screens, go single‑column */
@media (max-width: 480px) {
  .projects-container {
    grid-template-columns: 1fr;
  }
}

/* Mobile tweak: stack labels & values */
@media (max-width: 480px) {
  .project-card__summary li {
    grid-template-columns: 1fr;
  }
  .label {
    margin-bottom: var(--spacing-xs);
  }
}

/* CONTACT SECTION */

#contactInfo {
  position: relative;
}

.contactBox {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  flex-direction: column;
  height: 70vh;
}

.info-upper-container {
  position: relative; /* Keeps it in the document flow */
  margin: 1rem auto; /* Add margin to create spacing from the element above */
  display: flex;
  justify-content: center;
  border-radius: 2rem;
  border: rgb(53, 53, 53) 0.1rem solid;
  border-color: rgb(163, 163, 163);
  background: white;
  padding: 0.5rem;
  max-width: 700px;
  width: 100%;
  box-sizing: border-box;
}

.contactInfo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem;
}

.contactInfo-container p {
  font-size: larger;
}

.contact-icon {
  cursor: default;
  height: 2rem;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.email-icon {
  height: 2.5rem;
}

/* FOOTER */

footer {
  text-align: center;
  padding: 32px 16px;
  color: #777;
  font-size: 12px;
}

/* 1st proto PARKINGPAL PROBLEM SECTION  */
#pp_problem {
  position: relative;
}

/* PP 1st proto CONTRIBUTION SECTION  */
#pp_contribution {
  position: relative;
}

/* PP 1st proto RESULT SECTION  */
#pp_result {
  position: relative;
}

/* fsae PROBLEM SECTION  */
#fsae_problem {
  position: relative;
  gap: 5rem;
}

/* fsae CONTRIBUTION SECTION  */
#fsae_contribution {
  position: relative;
}

/* fsae RESULT SECTION  */
#fsae_result {
  position: relative;
}

/* PP 2nd proto PROBLEM SECTION  */
#pp1_problem {
  position: relative;
}
/* PP 2nd proto CONTRIBUTION SECTION  */
#pp1_contribution {
  position: relative;
}
/* PP 2nd proto RESULT SECTION  */
#pp1_result {
  position: relative;
}
/* research PROBLEM SECTION  */
#research_problem {
  position: relative;
}
/* research CONTRIBUTION SECTION  */
#research_contribution {
  position: relative;
}
/* research RESULT SECTION  */
#research_result {
  position: relative;
}

.article-container {
  max-width: 800px;
  margin: 2rem auto;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  justify-items: center; /* center items in their cell */
}

.image-grid img {
  width: 100%;
  height: auto; /* natural aspect */
  display: block;
  border-radius: 0.75rem;
  object-fit: cover;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

/* Hover effect stays the same */
.image-grid img:hover {
  transform: scale(1.03);
}

/* If there’s only one image, span it across both columns and center it */
.image-grid img:only-child {
  grid-column: 1 / -1; /* span from first to last column */
  width: 80%; /* or adjust as you like */
  justify-self: center; /* center within that span */
}

/* Mobile: single column */
@media (max-width: 480px) {
  .image-grid {
    grid-template-columns: 1fr;
  }
  .image-grid img:only-child {
    width: 100%; /* full width on mobile */
  }
}

/* === Layout & Spacing Improvements === */

/* Give each section breathing room */
section {
  margin-bottom: var(--spacing-lg, 2rem);
  padding-bottom: var(--spacing-md, 1rem);
  /* Remove or adjust height to allow natural content flow */
  min-height: 40vh;
  height: auto; /* Remove fixed 96vh, let content decide */
}

/* Headings spacing */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: var(--spacing-md, 1rem);
  margin-bottom: var(--spacing-md, 1rem);
  line-height: 1.2;
}

/* Paragraphs, lists, add breathing room */
p,
ul,
ol {
  margin-bottom: var(--spacing-sm, 0.5rem);
}

/* Cards and content containers */
.card,
.project-card,
.article-container,
.section,
.about-container {
  margin-bottom: var(--spacing-lg, 2rem);
  padding: var(--spacing-md, 1rem);
  background: var(--color-bg, #fff);
  border-radius: var(--radius, 1rem);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Adjust .main-content to prevent horizontal squish */
.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--spacing-lg, 2rem) var(--spacing-md, 1rem);
}

/* Add gap to flex containers */
.section-container,
.about-container,
.skills-section,
.skills-grid,
.projects-container {
  gap: var(--spacing-lg, 2rem);
}

/* Project grid spacing */
.projects-container {
  margin-top: var(--spacing-lg, 2rem);
  margin-bottom: var(--spacing-lg, 2rem);
}

/* Responsive improvements for mobile */
@media (max-width: 700px) {
  .main-content {
    padding: var(--spacing-md, 1rem);
  }
  section {
    margin: 0 0 var(--spacing-md, 1rem) 0;
    padding-bottom: var(--spacing-sm, 0.5rem);
    min-height: 20vh;
  }
  .card,
  .project-card,
  .article-container,
  .section,
  .about-container {
    margin-bottom: var(--spacing-md, 1rem);
    padding: var(--spacing-sm, 0.5rem);
  }
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: var(--spacing-sm, 0.5rem);
    margin-bottom: var(--spacing-sm, 0.5rem);
  }
}

/* CONSOLIDATED BUTTON STYLES */

/* SCROLL INDICATOR */
.scroll-indicator {
  margin-top: 1rem;
  text-align: center;
  color: #111827;
  opacity: 0.8;
}

.scroll-indicator p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.scroll-indicator i {
  animation: bounce 2s infinite;
  color: #111827;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* CALL TO ACTION */
.cta-section {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-accent) 100%
  );
  color: white;
  padding: var(--spacing-lg) var(--spacing-md);
  text-align: center;
  margin: var(--spacing-md) 0;
  border-radius: var(--radius);
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  font-weight: bold;
}

.cta-section p {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-cta-primary {
  background: white;
  color: var(--color-primary);
  padding: 0.8rem 2rem;
  border-radius: 2rem;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  border: 2px solid white;
}

.btn-cta-primary:hover {
  background: transparent;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-cta-secondary {
  background: transparent;
  color: white;
  padding: 0.8rem 2rem;
  border: 2px solid white;
  border-radius: 2rem;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-cta-secondary:hover {
  background: white;
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* BACK TO TOP BUTTON */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* PROJECT CARD HOVER EFFECTS */
.project-card {
  transition: all 0.3s ease;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-card__image {
  overflow: hidden;
}

.project-card__image img {
  transition: transform 0.3s ease;
}

.project-card:hover .project-card__image img {
  transform: scale(1.05);
}

/* SKILL ITEM HOVER EFFECTS */
.skill-item {
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.skill-item:hover {
  background: var(--color-contrast);
  transform: translateY(-2px);
}


/* NAVIGATION IMPROVEMENTS */
.navbar a:hover {
  transform: translateY(-1px);
}

/* SMOOTH SCROLL ANIMATIONS & PERFORMANCE */
@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }

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

  .slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  }

  .slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
  }

  .slide-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  }

  .slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
  }

  .scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }

  .scale-in.visible {
    opacity: 1;
    transform: scale(1);
  }
}

/* PERFORMANCE OPTIMIZATIONS */
.skill-item img,
.contact-icon,
.project-card__image img {
  will-change: transform;
}

.btn {
  will-change: transform, box-shadow;
}

/* LOADING SKELETON ANIMATIONS */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.skeleton-text.title {
  height: 2rem;
  width: 60%;
  margin: 0 auto 1rem;
}

.skeleton-text.line {
  width: 100%;
}

.skeleton-text.line:nth-child(even) {
  width: 85%;
}

.skeleton-text.short {
  width: 70%;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: var(--radius);
}

/* Image loading states */
img.loading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.loaded {
  opacity: 1;
}

/* TOUCH IMPROVEMENTS */
@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .skill-item:hover,
  .project-card:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  /* Larger touch targets on mobile */
  .btn {
    min-height: 48px;
    min-width: 48px;
  }

  .contact-icon {
    min-height: 48px;
    min-width: 48px;
  }

  .navbar a {
    padding: 12px 16px;
  }
}
