:root {
  /* Black to white color scheme */
  --black: hsl(0, 0%, 5%);
  --dark-grey: hsl(0, 0%, 20%);
  --medium-grey: hsl(0, 0%, 40%);
  --light-grey: hsl(0, 0%, 70%);
  --white: hsl(0, 0%, 95%);
  
  --bg-color: var(--black);
  --text-color: hsl(0, 0%, 98%);
  --accent-color: hsl(220, 60%, 45%);
  
  --section-spacing: 120vh;
  --border-radius: 20px;
  --border-radius-small: 12px;
  --transition-duration: 0.3s;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
  transition: background var(--transition-duration) ease-out;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}


.content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  padding-top: 3.5rem;
}

.section {
  min-height: var(--section-spacing);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  position: relative;
}

.section#intro {
  align-items: flex-start;
  padding-top: 30vh;
}

.section-content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Intro Section */
.name {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-color), var(--text-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  letter-spacing: -0.02em;
}

.title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 2rem;
  text-align: center;
  opacity: 0.9;
}

.bio {
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 3rem;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.8;
}

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.contact-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-item .label {
  font-size: 0.9rem;
  opacity: 0.7;
  font-weight: 600;
}

.contact-item a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.contact-item a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Section Titles */
.section-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 600;
  margin-bottom: 3rem;
  text-align: center;
  color: var(--accent-color);
}

/* Experience Section */
.experience-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 2.5rem;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.experience-item h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.company-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.company {
  font-weight: 600;
  font-size: 1.1rem;
}

.duration {
  opacity: 0.7;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.achievements {
  list-style: none;
  margin-top: 1.5rem;
}

.achievements li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.achievements li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

/* Education Section */
.education-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 2.5rem;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.education-item h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.institution-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.institution {
  font-weight: 600;
  font-size: 1.1rem;
}

.coursework {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.coursework .label {
  font-weight: 600;
  opacity: 0.7;
}

.certifications {
  margin-top: 2rem;
}

.certifications h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
}

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

.cert-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: var(--border-radius-small);
  text-align: center;
  font-weight: 500;
}

/* Projects Section */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.project-item h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}


.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tech {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Skills & Interests Section */
.skills-interests-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.skills-column h3,
.interests-column h3 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--accent-color);
}

.skill-category {
  margin-bottom: 2rem;
}

.skill-category h4 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.6rem 1rem;
  border-radius: var(--border-radius-small);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.interest-item {
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: var(--border-radius-small);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.interest-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  color: var(--accent-color);
}

.interest-item p {
  opacity: 0.8;
  line-height: 1.6;
}

/* Static Navigation Header */
.static-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  padding: 0.5rem 0;
  transition: background 0.3s ease-out, transform 0.3s ease-out;
}

.nav-sections {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem 2rem;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  transition: all 0.3s ease-out;
}

.nav-item {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-small);
  transition: all 0.3s ease;
  opacity: 0.7;
  position: relative;
}

.nav-item:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
  opacity: 1;
  background: var(--accent-color);
  color: white;
  font-weight: 600;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 50%;
}

/* Fallback Progress */
.fallback-progress {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem;
  border-radius: var(--border-radius-small);
  z-index: 100;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.fallback-progress progress {
  width: 200px;
  height: 8px;
  border-radius: 4px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  :root {
    --section-spacing: 100vh;
    --pipe-height: var(--pipe-height-mobile);
  }

  .section {
    padding: 2rem 1rem;
  }

  .section#intro {
    padding-top: 25vh; /* Reduced from 37.5vh for mobile */
  }

  .skills-interests-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .contact {
    grid-template-columns: 1fr;
  }

  .company-info,
  .institution-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Improved mobile navigation */
  .nav-sections {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    border-radius: 15px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-sections::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    min-width: fit-content;
    touch-action: manipulation;
  }

  /* Better touch targets */
  .nav-item:hover {
    transform: scale(1.05);
  }

  .fallback-progress {
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
  }

  .fallback-progress progress {
    width: 150px;
    height: 6px;
  }

  /* Moderate text size reduction for tablets */
  .experience-item h3,
  .education-item h3,
  .project-item h3 {
    font-size: 1.35rem;
  }

  .experience-item p,
  .education-item p,
  .project-item p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .achievements li {
    font-size: 0.9rem;
  }

  .tech {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
  }
}

@media (max-width: 480px) {
  :root {
    --section-spacing: 90vh;
  }

  .section {
    padding: 1.5rem 0.75rem;
  }

  .section#intro {
    padding-top: 20vh; /* Even more compact on small phones */
  }

  .experience-item,
  .education-item,
  .project-item {
    padding: 1rem;
  }

  .contact-item {
    padding: 0.875rem;
  }

  /* Reduce text sizes in content boxes for mobile */
  .experience-item h3,
  .education-item h3,
  .project-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .experience-item p,
  .education-item p,
  .project-item p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .company-info,
  .institution-info {
    margin-bottom: 1rem;
  }

  .company,
  .institution {
    font-size: 1rem;
  }

  .duration {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
  }

  .achievements {
    margin-top: 1rem;
  }

  .achievements li {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
  }

  .tech-stack {
    margin-top: 1rem;
    gap: 0.375rem;
  }

  .tech {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .coursework {
    margin-top: 1rem;
    gap: 0.375rem;
  }

  .coursework .label {
    font-size: 0.875rem;
  }

  .coursework span:not(.label) {
    font-size: 0.875rem;
  }

  /* Optimize contact and skills sections */
  .contact-item .label {
    font-size: 0.8rem;
  }

  .contact-item span:not(.label),
  .contact-item a {
    font-size: 0.875rem;
  }

  .skill-category h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .skill {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .interest-item h4 {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
  }

  .interest-item p {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  /* Smaller nav for very small screens */
  .nav-sections {
    padding: 0.4rem 0.5rem;
    gap: 0.25rem;
    margin: 0 0.5rem;
  }

  .nav-item {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }

  /* Improve text readability on small screens */
  .name {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .bio {
    font-size: 1rem;
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-duration: 0s;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    transition: none;
  }

  .static-header {
    transition: none !important;
  }

  .project-item {
    transition: none;
  }

  .project-item:hover {
    transform: none;
  }
}