:root {
  --ui-duration: 0.6s;
  --ui-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── Base Layout & Background ───────────────────────────────────────── */
body {
  margin: 0;
  padding: 20px;
  font-family: "Inter", monospace;
  background: radial-gradient(ellipse at top, #0f0f0f, #000);
  color: #fff;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

/* ── 1) globally include padding & borders in width calculations ── */
html,
*,
*::before,
*::after {
  box-sizing: border-box;
  font-size: 16px;
}

/* ─── Scrollbar Styling ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #fff;
  border-radius: 3px;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #fff transparent;
}

#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

/* ─── Navigation ─────────────────────────────────────────────────────── */
#nav-toggle,
#nav-toggle:hover {
  cursor: pointer;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 101;
  transition: transform 0.4s ease;
}
#nav-toggle.rotated {
  transform: rotate(90deg);
}
.nav {
  position: fixed;
  top: 10%;
  left: 0;
  display: grid;
  grid-template-rows: repeat(4, auto);
  gap: 1rem;
  padding: 2rem;
  width: 100%;
  max-width: 300px;
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  z-index: 101;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0);
}
.nav.active {
  transform: translateX(20%);
}
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  position: relative;
  transition: color 0.3s;
}
.nav a:hover {
  color: #aaa;
}
.nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 4px;
  bottom: -10px;
  left: 0;
  background: #fff;
  transition: width 0.4s ease;
}
.nav a:hover::after {
  width: 100%;
}

/* ─── Typing Area ─────────────────────────────────────────────────────── */
.container {
  max-width: 900px;
  width: 100%;
  text-align: center;
  z-index: 10;
  position: relative;
  backdrop-filter: blur(10px);
  padding: 3rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.typed-text {
  white-space: pre-line;
  font-size: 24px;
  line-height: 2;
  font-family: monospace;
  min-height: 100px;
}
.cursor {
  display: inline-block;
  width: 14px;
  font-size: 30px;
  line-height: 2;
  animation: smooth-blink 0.8s ease-in-out infinite;
  margin-left: 2px;
}
@keyframes smooth-blink {
  0%,
  100% {
    opacity: 1;
  }
  40%,
  60% {
    opacity: 0;
  }
}
.button-container {
  margin-top: 20px;
}
.typing-button {
  display: inline-block;
  margin: 40px 40px 0 0;
  height: 80px;
  width: 110px;
  font-size: 16px;
  border: 0;
  font-family: "Verdana", sans-serif;
  color: #000;
  font-style: italic;
  background: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.typing-button.highlight {
  opacity: 1;
}
.typing-button:hover {
  backdrop-filter: blur(10px);
  background-color: transparent;
  color: #fff;
}

/* ─── Main View ─────────────────────────────────────────────────────── */
#mainView {
  opacity: 1;
  pointer-events: auto;
  transition: opacity var(--ui-duration) var(--ui-ease);
  z-index: 10;
  position: relative;
}
#mainView.hidden {
  opacity: 0;
}

/* ─── Experience ─────────────────────────────────────────────────────── */
.section-title {
  text-align: center;
}
.experience-entries {
  margin-top: 5%;
  margin-right: 10%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 2rem;
  margin-bottom: 1.5rem;
}
.experience-entries::-webkit-scrollbar {
  width: 6px;
}
.experience-entries::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
.experience-section {
  margin-bottom: 10%;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.experience-section:last-of-type {
  border-bottom: none;
}
.experience-entry {
  text-align: left;
  margin-bottom: 2rem;
  max-width: 90%;
  padding-left: 1rem;
  border-left: 2px solid rgba(255, 255, 255, 0.05);
}
.experience-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 769px) {
  #experience.detail-section,
  #research.detail-section,
  #projects.detail-section {
    display: grid;
    grid-template-columns: 30% 70%;
    align-items: center;
    justify-content: center;
  }
}
.title-row,
.company-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}
.title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}
.location {
  font-style: italic;
  font-size: 0.9rem;
  color: #bbb;
  text-align: right;
}
.company {
  font-weight: 500;
  font-size: 0.9rem;
  color: #aaa;
}
.date-range {
  font-size: 0.85rem;
  font-style: italic;
  color: #888;
  text-align: right;
}
.experience-entry ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0;
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.6;
}
.experience-entry li {
  margin-bottom: 0.4rem;
}

/* ─── Projects Panel ────────────────────────────────────────────────── */
.project-list {
  display: grid;
  gap: 2rem;
  margin: 0 auto 0 0;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: 15%;
  padding-bottom: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  justify-content: center;
  align-items: center;
}
.project-item,
.project-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.project-item img,
.project-card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform var(--ui-duration) var(--ui-ease);
}
.project-item:hover img {
  transform: scale(1.05);
}
.project-item .project-description {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  padding: 1rem;
  opacity: 0.85;
  transform: translateY(100%);
  transition: transform var(--ui-duration) var(--ui-ease);
  box-sizing: border-box;
}
.project-item:hover .project-description {
  transform: translateY(0);
   

}
.project-card .overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  box-sizing: border-box;
  /* carve out a fixed 4rem header (for your title), then the rest for desc/tags */
  display: grid;
  grid-template-rows: 4rem auto;

  /* keep your “peek” animation exactly as before */
  transform: translateY(calc(100% - 4rem));
  transition: transform var(--ui-duration) var(--ui-ease);
}
.project-card .overlay h3 {
  margin: 0;
  padding: 0 2rem;          /* same left/right gutters you already had */
  font-size: 1rem;          /* original size—override in media if you like */
  font-weight: bold;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
  align-self: center;       /* vertically center within the 4rem row */
}
.project-card .overlay p,
.project-card .overlay .tags {
  margin: 0.5rem 1rem;
}
.project-card:hover .overlay {
  transform: translateY(0);
  cursor: pointer;
}



/* ─── Detail Overlay & Section ──────────────────────────────────────── */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity var(--ui-duration);
  z-index: 200;
  pointer-events: none;
}
.detail-overlay.active,
.detail-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.detail-section {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 40% 60%;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 0;
  transition: opacity var(--ui-duration) var(--ui-ease);
  pointer-events: none;
}
.detail-section.showing {
  opacity: 1;
  z-index: 300;
  pointer-events: auto;
}
.detail-section h2 {
  text-align: center;
  align-self: center;
  font-size: 2rem;
}
.detail-section-content-about {
  margin: 0 10% 0 0;
  padding: 0 5%;
  display: flex;
  font-size: 1.2rem;
  justify-content: left;
  flex-direction: column;
  margin-top: 10%;
  margin-bottom: 10%;
  align-self: stretch;
  overflow-y: auto;
  overflow-x: hidden;
}
.detail-section-content-about ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1em 0;
  line-height: 2;
}
.detail-section h4 {
  font-size: 1.5rem;
}

/* ─── Awards Section ────────────────────────────────────────────────── */
.awards-section {
  list-style: none;
  padding: 0;
  margin: 0 0 1em 0;
  display: grid;
  gap: 0.25em 0.5em;
}
.awards-section li {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: start;
  position: relative;
  padding-left: 1.2em;
  line-height: 1.6;
}
.awards-section li::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  top: 0.8em;
  left: 0;
  background: currentColor;
  border-radius: 50%;
}
.awards-section .award-meta {
  text-align: right;
  opacity: 0.85;
}

/* ─── Back Button ───────────────────────────────────────────────────── */
.back-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  transition: background 0.2s, color 0.2s;
}
.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ─── Global Link Styling ───────────────────────────────────────────── */
a {
  color: #00bfff;
  text-decoration: underline;
  cursor: pointer;
}
a:hover {
  color: #1e90ff;
}

/* ─── Responsive Media Queries ──────────────────────────────────────── */
@media (max-width: 480px) {
  .container {
    width: 100%;
    max-width: 360px;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 1rem;
    margin: 0 auto;

  }
  .typed-text {
    font-size: 14px;
    line-height: 2;
    min-height: 80px;
  }
  .button-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 16px;
  }
  .typing-button {
    width: 100%;
    height: 48px;
    font-size: 13px;
    margin: 0;
    padding: 0 0.5rem;
  }
  .nav {
    width: 100%;
    height: 10%;
    transform: translateX(-100%);
  }
  .nav a {
    font-size: 1rem;
  }
  .nav.active {
    transform: translateX(0);
  }
  #nav-toggle {
    font-size: 2.4rem;
    top: 1rem;
    left: 1rem;
  }
  .detail-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
  }
  .detail-section h2 {
    font-size: 1.5rem;
    width: 100%;
    text-align: center;
    margin: 3rem 0 0.75rem 0;
  }
  .detail-section h4 {
    font-size: 1.125rem;
  }
  .detail-section-content-about,
  .experience-entries,
  .awards-section li,
  .skills-section li {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-top: 15%;
    margin-bottom: 11%;
    width: 100%;
    margin: 0;
    padding: 0;
    padding-right: 7%;
  }

  .awards-section li {
    /* restore just enough indent for the bullet + a gap */
    padding-left: 1.5rem;
    /* (and lose those giant top/bottom percentages—you probably want something like:) */
    margin: 0.5rem 0;
    width: auto;
  }

  .skills-section li {
    padding-bottom: 3%;
  }
  #projects .project-list {
    margin: 0 auto; /* centers left/right */
    width: 100%; /* fill the container */
    max-width: 360px; /* or calc(100% – 2rem) to respect your padding */
  }
.project-card .overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    /* carve out a 4rem-tall header, then the rest for your desc/tags */
    display: grid;
    grid-template-rows: 4rem auto;
    /* your existing peek-height transform */
    transform: translateY(calc(100% - 4rem));
    transition: transform var(--ui-duration) var(--ui-ease);
    box-sizing: border-box;
  }
  .project-card:hover .overlay {
    transform: translateY(0);
  }

  /* 1) center that h3 vertically inside the 4rem row
     2) keep its horizontal padding exactly where you already had it */
  .project-card .overlay h3 {
    margin: 0;               /* kill default margins */
    padding: 0 2rem;         /* your left/right gutters */
    font-size: 0.75rem;      /* as before */
    align-self: center;      /* grid-row 1 is 4rem tall → this vertically centers */
  }

}

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    max-width: 90%;
    padding: 2rem 1.5rem;
    margin: 0 auto;
  }
  .nav a {
    font-size: 1.2rem;
  }
  .typed-text {
    font-size: 1.125rem;
    line-height: 1.5;
  }
  .button-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
  }
  .typing-button {
    width: 100%;
    height: 60px;
    font-size: 0.875rem;
    margin: 0;
  }
  .detail-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
  }
  .detail-section h2 {
    font-size: 1.75rem;
    width: 100%;
    text-align: center;
    margin: 0 0 0.75rem 0;
  }
  .detail-section h4 {
    font-size: 1.25rem;
  }
  .detail-section-content-about,
  .experience-entries,
  .awards-section li,
  .skills-section li {
    font-size: 0.95rem;
    line-height: 1.5;
    width: 100%;
    margin: 0;
    padding: 0;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .detail-section h2 {
    font-size: 2rem;
  }
  .detail-section h4 {
    font-size: 1.5rem;
  }
  .detail-section-content-about,
  .experience-entry ul,
  .awards-section li,
  .skills-section li {
    font-size: 1rem;
    line-height: 1.6;
  }
}

@media (min-width: 960px) {
  .project-list {
    grid-template-columns: repeat(3, 1fr);
  }
}
