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

html {
    scroll-behavior: smooth;
    scroll-timeline: smooth;
    min-width: var(--min-total-width);
    overflow-x: auto;
}

/* Make scrolling smoother with custom timing */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
        scroll-timeline: smooth;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

main {
    position: relative;
    min-height: 200vh;
    transition: background-color 0.1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: var(--min-total-width);
}

section {
    scroll-margin-top: 2rem;
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0B1215;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
  }
  
  /* Spinner ring */
  .spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top: 6px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  

/* Center containers horizontally */
.container {
    width: min(var(--container-width), calc(100% - var(--nav-width) - var(--nav-content-gap) - 2rem));
    max-width: var(--max-content-width);
    margin: 0 auto;
}

/* Center all section headings */
.about h2,
.projects h2,
.publications h2,
.contact h2 {
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
}

/* Content containers */
.about-content,
.projects-content,
.publications-content,
.contact-content {
    width: 100%;
    max-width: var(--max-content-width);
    margin: 0 auto;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.about-photo {
    flex-shrink: 0;
}

.profile-photo {
    /* width: 180px; */
    height: 20rem;
    object-fit: cover;
    border-radius: 10%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    border: 4px solid #fff;
    background: #eee;
    margin-bottom: 1rem;
}

/* Center hero section */
.hero {
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    width: 100%;
}

/* Center text container */
.text-container {
	text-align: center;
	margin-bottom: 4rem;
	/* position: relative; */
	width: min(var(--container-width), calc(100% - var(--nav-width) - var(--nav-content-gap) - 2rem));
	max-width: var(--max-content-width);
	/* left: 50%; */
	/* transform: translateX(-50%); */
}

.typing-text {
	font-size: clamp(2.5rem, 10vw, 6rem); /* Responsive font size */
	font-weight: 700;
	/* position: absolute; */
	top: 0;
	/* left: 50%; */
	/* transform: translateX(-50%); */
	margin-bottom: 1rem;
	white-space: nowrap;
}

.subtitle {
	font-size: clamp(1rem, 4vw, 1.5rem); /* Responsive font size */
	color: #a0a0a0;
	transition: opacity 0.5s ease;
	position: absolute;
	white-space: nowrap;
	/* top: 80px; */
	left: 50%;
	transform: translateX(-50%);
}

.cursor {
    display: inline-block;
    margin-left: 0.1em;
    border-right: 0.1em solid currentColor;
    animation: blink 0.7s infinite;
    vertical-align: bottom;
    position: relative;
    width: 0.1em;
    visibility: visible;
    transition: visibility 0.1s;
}

.cursor.hidden {
    visibility: hidden;
}

.typing-text .cursor {
    height: 0.85em;
    bottom: 0.05em;
}

.subtitle .cursor {
    height: 1em;
    bottom: 0.05em;
}

.project-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
    margin-bottom: 2.5rem;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.project-description {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.6;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
    max-width: 90%;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tech-tag {
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 500;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    text-decoration: none;
    background: rgba(0, 0, 0, 0.05);
    color: inherit;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.publication-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.publication-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.publication-card h3 {
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
    margin-bottom: 0.8rem;
    transition: color 0.3s ease;
}

.publication-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.publication-authors {
    font-style: italic;
}

.publication-journal {
    font-weight: 500;
}

.publication-year {
    color: #888;
}

.publication-card p {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.6;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.publication-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.publication-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    transition: all 0.2s ease;
}

.publication-link:hover {
    background: #e5e5e5;
    transform: translateY(-2px);
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    color: inherit;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.2);
}

.contact-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.2);
}

.contact-text {
    margin-bottom: 2.5rem;
    text-align: center;
}

.contact-text p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.8;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.about, .projects, .publications {
    min-height: 100vh;
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
    width: 80%;
}

.contact {
    min-height: 100vh;
    padding: 4rem 2rem 6rem 2rem; /* add extra bottom padding */
    position: relative;
    z-index: 2;
    width: 80%;
    scroll-margin-top: 2rem; /* already defined globally for smooth scroll */
}


.about h2 {
	font-size: 3rem;
	margin-bottom: 2rem;
	text-align: center;
	transition: color 0.3s ease;
	/* position: relative; */
	/* left: 50%; */
	/* transform: translateX(-50%); */
}

.about-text {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.8;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.skills h3 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

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

.skill-tag {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Scroll Indicator Styles */
.scroll-indicator {
	position: absolute;
	bottom: 6rem;
	/* left: 50%; */
	/* transform: translateX(-50%); */
	cursor: pointer;
	opacity: 0;
	animation: fadeInNav 0.5s ease forwards;
	animation-delay: 2s;
	padding: 20px;
	margin: -20px;
	z-index: 10;
}

.scroll-arrow {
	width: 20px;
	height: 20px;
	border-right: 3px solid currentColor;
	border-bottom: 3px solid currentColor;
	transform: rotate(45deg);
	margin: 0 auto;
}


@keyframes bounceDown {
    0% {
        transform: translateY(0) rotate(45deg);
    }
    50% {
        transform: translateY(10px) rotate(45deg);
    }
    100% {
        transform: translateY(0) rotate(45deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Navigation Panel */
.nav-panel {
    position: fixed;
    left: var(--nav-content-gap);
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    opacity: 0;
    animation: fadeInNav 0.5s ease forwards;
    animation-delay: 2s;
    width: var(--nav-width);
}

.nav-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: all 0.3s ease;
    color: #ffffff;
    padding-left: 0.5rem;
    font-weight: 400;
}

.nav-item:hover {
    opacity: 0.8;
}

.nav-item.active {
    opacity: 1;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-text {
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 1.2rem;
}

.nav-item:hover .nav-text {
    transform: translateX(0);
    opacity: 1;
}

.nav-panel.no-delay {
    opacity: 1;
    animation: none;
}

/* Add a separate fade in animation for nav panel that doesn't affect position */
@keyframes fadeInNav {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Footer */
.footer {
    height: 3rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
    background-color: #0B1215;
    color: #ffffff;
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

.footer-link {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-link:hover {
    opacity: 1;
}

/* Responsive text sizes */
h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}


:root {
    --container-width: 95%;
    --max-content-width: 90rem;
    --nav-width: 12rem;
    --nav-content-gap: 2.5rem;
    --min-total-width: calc(var(--nav-width) + var(--nav-content-gap) + 50rem);
}

/* Prevent horizontal scroll except on very small screens */
html, body {
    overflow-x: auto;
    min-width: 320px;
}

/* body, html {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="10" fill="none" stroke="black" stroke-width="2"/></svg>') 16 16, pointer;
} */

.tech-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    margin-right: 0.4em;
}

.about-skills-icons {
    display: flex;
    flex-wrap: nowrap;
    /* justify-content: space-evenly; */
    align-items: center;
    width: auto;
    max-width: var(--max-content-width);
    margin: 2.5rem auto 1.5rem auto;
    gap: 1.5rem;
    overflow-x: auto;
}

.about-skills-icons .tech-tag {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    transition: none;
    flex: 1 1 60px;
    display: flex;
    justify-content: center;
}

.about-skills-icons .tech-icon {
    width: auto;
    height: 2rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.about-skills-icons .tech-tag:hover .tech-icon {
    opacity: 1;
}

#cursor-ring {
    position: fixed;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(200, 200, 200, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.05s ease;
}

#cursor-ring.hovered {
    transition: opacity 0.1s ease, transform 0.4s ease;
    transform: translate(-50%, -50%) scale(1.4); /* Larger ring on hover */
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    margin: 2rem auto 0;
    width: 100%;
    background-color: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  }
  
  .form-row {
    display: flex;
    gap: 1rem;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  
  .contact-form label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #0B1215;
    margin-bottom: 0.4rem;
  }
  
  .contact-form input,
  .contact-form textarea {
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #ffffff;
    color: #0B1215;
    border: 1px solid rgba(11, 18, 21, 0.2);
    transition: border-color 0.2s ease;
  }
  
  .contact-form input:focus,
  .contact-form textarea:focus {
    border-color: #0B1215;
    outline: none;
  }
  
  .contact-form textarea {
    resize: vertical;
  }
  
  .contact-form button {
    padding: 1rem 2rem;
    background-color: #0B1215;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  .contact-form button:hover {
    background-color: #1a2428;
  }
  
/* Base styles for the menu icon - hidden by default */
.menu-icon {
  display: none;
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 30px;
  height: 24px;
  cursor: pointer;
  z-index: 10000;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  box-sizing: content-box;
}

.menu-icon .bar {
  width: 100%;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Media query for screens smaller than 1050px */
@media (max-width: 1050px) {
  :root {
    --nav-width: 0rem;
    --nav-content-gap: 0rem;
    --container-width: 90%;
  }

  /* Hide the fixed navigation panel */
  .nav-panel {
    display: none;
    /* When active, it will be styled to overlay */
  }

  /* Show the menu icon */
  .menu-icon {
    display: flex;
  }

  main {
    min-width: initial; 
  }

  .about,
  .projects,
  .publications,
  .contact {
    width: 90%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .typing-text {
    font-size: clamp(3rem, 6vw, 4rem);
  }

  .about h2, .projects h2, .publications h2, .contact h2 {
    font-size: clamp(2.5rem, 4vw, 2rem);
  }

  /* Styles for the active (open) navigation panel */
  .nav-panel.active {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transform: none;
    background-color: rgba(11, 18, 21, 0.95);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 9000;
    opacity: 0;
    animation: fadeInNav 0.3s ease forwards;
  }

  /* Styles for the menu icon when open (transforms to X) */
  .menu-icon.open .bar:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
  }

  .menu-icon.open .bar:nth-child(2) {
    opacity: 0;
  }

  .menu-icon.open .bar:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
  }

  /* About Me Section specific adjustments */
  .about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo {
    height: auto;
    width: 70%;
    max-width: 250px;
  }

  .about-text {
    text-align: center;
    max-width: 100%;
  }

  .about-skills-icons {
    justify-content: center;
  }

  /* Projects section specific adjustments */
  .project-card {
    padding: clamp(1rem, 3vw, 1.5rem);
  }

  .project-card h3{
    font-size: clamp(1.5rem, 4vw, 1rem);
  }

  .project-description {
    max-width: 100%;
  }

  .project-tech {
    justify-content: center;
  }

  .project-links {
    justify-content: center;
  }

  .contact-text p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    line-height: 1.6;
  }

  .contact-link {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    padding: 0.8rem 1.5rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .contact-form .form-row {
    flex-direction: column;
    gap: 1.5rem; 
  }
}
  
  
  