/* ==========================================================================
   Variables & Reset
   ========================================================================== */

:root {
  /* Layout */
  --site-max-width: 1200px;     /* Overall site container width */
  --content-width: 1200px;      /* Main content area width */
  --padding-x: 30px;           /* Consistent horizontal padding */
  --nav-height: 80px;
  --content-max-width: 1200px;   /* For article content */
  --container-width: 1200px;    /* Reduced from 1600px for content */
  --breakpoint-sm: 480px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1200px;

  /* Colors */
  --primary-color: #333;
  --secondary-color: #666;
  --accent-color: #1E4D6B;
  --background-color: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 0, 0, 0.1);

  /* Gallery */
  --gallery-dot-size: 0.75rem;
  --gallery-dot-size-mobile: 0.5rem;

  /* Transitions */
  --transition: all 0.2s ease;
}

@import "{{ site.theme }}";

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

.inner {
  max-width: 100%;
}

.site-title {
  color: var(--accent-color) !important;
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.5rem; /* Increased from default */
}

.site-title:hover {
  opacity: 0.9;
}

/* GitHub icon styling */
.project-github {
  color: var(--secondary-color);
  font-size: 0.8em;
  margin-left: 10px;
  transition: var(--transition);
}

.project-github:hover {
  color: var(--accent-color);
}

/* Base Styles */
body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-top: var(--nav-height);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  color: var(--primary-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.main-wrapper {
  width: 100%;
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
}

/* Base image styles */
img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Remove duplicate styling from image container */
.image-item {
  margin-bottom: 30px;
}

.fun-grid-item figcaption {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-style: italic;
  padding: 0;
}

/* Specific image container styles */
.image-item img,
.grid-item img {
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.image-item img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
}

.content-column img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

.image-item.circle img {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  width: 500px;
  height: 500px;
  margin: 0 auto;
  display: block;
  object-fit: cover;
}

.timeline-section .timeline-image {
  max-height: 400px;
  object-fit: contain;
}

/* Hover effects */
.image-item img:hover,
.fun-grid-item img:hover {
  transform: scale(1.02);
}

html, body {
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* ==========================================================================
   Navigation
   ========================================================================== */
   /* Header Icons */
.header-icons {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header-icons a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
  font-size: 2rem;
}

.header-icons a:hover {
  color: var(--accent-color);
}

/* Update header/nav transparency and blur */
.nav-wrapper {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

/* Desktop Navigation */
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  align-items: center;
}

.nav-links a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.25rem; /* Increased from 1rem */
  padding: 0.5rem 0;
  font-weight: 400;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.nav-links a.active {
  color: var(--accent-color);
}



/* ==========================================================================
   Layout Components
   ========================================================================== */

/* Main container resets */
.main-container {
  width: 100%;
  max-width: var(--max-width) !important;
  margin: 0 auto !important;
  padding: 0 var(--padding-x) !important;
}

/* Content wrapper adjustments */

.content-wrapper {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
  position: relative;
}

.container-fluid {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
}

.project-list {
  counter-reset: project-counter;
  margin: 2rem 0;
}

.project-list p strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  counter-increment: project-counter;
}

.project-list p strong::before {
  content: counter(project-counter) ". ";
  font-weight: bold;
  color: var(--accent-color);
}

.project-list p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

.project-list ul {
  margin: 0.5rem 0 1.5rem 2.5rem;  /* Increased left margin for indentation */
  padding-left: 1rem;
}

.project-list ul li {
  font-size: 0.95rem;  /* Slightly smaller than main text */
  margin-bottom: 0.75rem;
  line-height: 1.5;
  color: var(--secondary-color);  /* Slightly lighter color for questions */
  font-style: italic;
}

/* Two Column Layout */
.two-column-layout {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  position: relative;
}

/* Content column width */
.content-column {
  flex: 0 0 65%;
}
.image-column {
  flex: 0 0 35%;
}

.research-content {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0;
}

/* Image handling */
.content-wrapper img,
.project-content img,
.research-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.three-column-grid,
.fun-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 40px 0;
  max-width: var(--max-width);
  padding: 0 var(--padding-x);
}

/* Grid items and fun grid items share same base styling */
.grid-item img,
.fun-grid-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}


/* ==========================================================================
   Typography
   ========================================================================== */
h1, .typing-text {
  font-size: 3em;
  margin-bottom: 30px;
  font-weight: 500;
}

h2 {
  font-size: 2.5em;
  margin: 40px 0 20px;
  font-weight: 500;
}

h3 {
  font-size: 2rem;
  margin: 35px 0 15px;
  font-weight: 500;
}

p {
  font-size: 1rem;
}

.greeting {
  font-size: 8rem;
  font-weight: 400;
}

.name {
  margin-left: 65px;
  font-size: 6rem;
  font-weight: 300;
}


/* ==========================================================================
   Content Components
   ========================================================================== */
/* Update intro-box styles with typing animation */
/* Base styles for the intro box */
.intro-box {
  width: fit-content;
  max-width: 1600px;
  background-color: #f8f9fa;
  padding: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  border-left: 5px solid #1E4D6B;
}

.intro-box-content {
  display: inline;
  width: 100%;
  font-family: monospace;
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.4;
  position: relative;
  color: #0000;
  background: linear-gradient(-90deg, #1E4D6B 5px, #0000 0) 10px 0,
              linear-gradient(#1E4D6B 0 0) 0 0;
  background-size: calc(var(--n)*1ch) 200%;
  -webkit-background-clip: padding-box, text;
  background-clip: padding-box, text;
  background-repeat: no-repeat;
  animation: typeIntro calc(var(--n)*0.03s) steps(var(--n)) forwards;
}

.intro-box-content strong {
  display: inline;
  font-family: inherit;
  font-weight: bold;
  font-size: inherit;
  color: inherit;
  background: inherit;
  -webkit-background-clip: inherit;
  background-clip: inherit;
  background-repeat: inherit;
  animation: b 0.3s infinite steps(1), t calc(var(--n)*0.01s) steps(var(--n)) forwards;
  text-decoration: none;
  font-style: normal;
}
/* Apply same animation to inline elements */
.intro-box-content em,
.intro-box-content a {
  display: inline;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
  background: inherit;
  -webkit-background-clip: inherit;
  background-clip: inherit;
  background-repeat: inherit;
  animation: inherit;
  text-decoration: none;
  font-style: italic;  /* This controls italics */
}

.intro-box-content .superscript {
  font-size: 0.75em;
  vertical-align: super;
}
.intro-box-content .italic {
  font-style: italic;  /* This controls italics */
}

/* Title styling */
.intro-box-title {
  font-weight: bold;
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: #1E4D6B;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Timeline Section */
.timeline-section {
  width: 100%;
  margin: 40px 0;
  padding: 20px 0;
  background-color: #fff;
}

.timeline-section .timeline-image {
  width: 100%;
  max-width: 1600px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Lab Section */
.lab-section {
  width: 100%;
  margin-bottom: 2rem;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
}

.lab-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.lab-section h4 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.lab-section {
  width: 100%;
  margin-bottom: 2rem;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
}

/* New styles for the split layout */
.lab-section-split {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lab-section-top {
  display: flex;
  gap: 2rem;
}

.lab-section-bottom {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

/* Maintain the existing two-column layout styles for the top section */
.lab-section-top .content-column {
  flex: 0 0 65%;
}

.lab-section-top .image-column {
  flex: 0 0 35%;
}

/* Style adjustments for the bottom section */
.lab-section-bottom ul {
  margin: 20px 0;
  padding-left: 40px;
  list-style-type: disc;
  max-width: var(--content-width);
}

.lab-section-bottom li {
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Media query adjustments */
@media (max-width: 1200px) {
  .lab-section-top {
    flex-direction: column;
  }

  .lab-section-top .content-column,
  .lab-section-top .image-column {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    flex: 0 0 100%;
  }
}

/* PDF Container for Resume Page */
.pdf-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
  height: calc(100vh - var(--nav-height) - 2rem);
}

.responsive-iframe-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.responsive-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.content-block ul,
.lab-section ul {
  margin: 20px 0 20px 60px;  /* Increased left margin */
  padding-left: 40px;
  list-style-type: disc;
}

.content-block ul > li,
.lab-section ul li {
  font-size: 1.1rem;
  margin-bottom: 10px;
  line-height: 1.4;
  padding-left: 20px;  /* Matches the negative text-indent */
}

/* Ordered List Styles */
.content-block ol {
  margin: 20px 0;
  padding-left: 40px;
  list-style-type: decimal;
}

.content-block ol > li {
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

/* Nested Lists */
.content-block ol > li ul {
  margin: 15px 0;
  padding-left: 25px;
  list-style-type: disc;
}

/* Common Paragraph Styles */
.content-block ol > li p,
.content-block ol > li strong,
.content-block ol > li ul > li p,
.lab-section p {
  font-size: 1rem;
  margin-bottom: 10px;
}

/* ==========================================================================
   Gallery Components
   ========================================================================== */
.project-description {
  margin-bottom: 40px;  /* Space between project descriptions */
}
.project-description ul {
  margin-top: 20px;
  margin-bottom: 40px;  /* Increased spacing after lists */
}

/* Project gallery specific */
.project-gallery {
  width: 100%;
  margin: 0 auto;
}
.project-gallery img {
  width: 100%;
  height: 500px;      /* Taller for project images */
  object-fit: contain;
}

.gallery-images {
  width: 100%;
  display: flex;
  overflow: hidden;
  padding: 1rem;
}

/* Gallery figures */
.gallery-images figure {
  flex: 0 0 100%;
  min-width: 100%;
  display: none;
  margin: 0;
  border-radius: 8px;
  transition: opacity 0.3s ease;
}

.gallery-images figure.active {
  display: block;
}

/* Gallery images */
.gallery-images img {
  width: 100%;
  height: auto;
  max-height: 500px;
  border-radius: 8px;
  object-fit: contain;
}

/* Navigation dots */
.gallery-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.gallery-dot {
  width: var(--gallery-dot-size);
  height: var(--gallery-dot-size);
  border-radius: 50%;
  background-color: #ccc;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.gallery-dot.active {
  background-color: var(--accent-color);
}

/* Center video container */
/* Video Controls */
video {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Video container styles can stay as is */
.video-container {
  text-align: center;
  margin: 2rem auto;
  width: 100%;
  max-width: 800px;
}

.video-container video,
.video-container iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
}

/* Base button link styles */
.button-link {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.button-link:hover {
  background-color: #0056b3;
  color: white;
  text-decoration: none;
}

/* Add centered variant */
.button-link.centered {
  display: block;
  width: fit-content;
  margin: 1.5rem auto;
  text-align: center;
}
/* Image Components */
.sticky-images {
  position: sticky;
  top: 40px;
  padding-bottom: 40px;
}

/* Base styles for captions and keywords */
.image-caption,
.grid-item figcaption,
.fun-grid-item figcaption {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-style: italic;
  padding: 0 var(--padding-x);
  line-height: 1.4;
}

.keywords {
  font-style: italic;
  color: var(--secondary-color);
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 20px;
  margin-top: 15px;
}

/* ==========================================================================
   Interactive Elements
   ========================================================================== */

.fun-note {
  background-color: #f8f9fa;
  border-left: 4px solid var(--accent-color);
  padding: 15px;
  margin: 20px 0;
  font-size: 0.95em;
  border-radius: 0 8px 8px 0;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes contentAppear {
 to { visibility: visible; }
}


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

@keyframes fadeIn {
 from { opacity: 0; }
 to { opacity: 1; }
}

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


/* Animation keyframes */
@keyframes t {
  from { background-size: 0 200% }
}

@keyframes b {
  50% { background-position: 0 -100%, 0 0 }
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}
/* Add slide animation from right */
@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes typeIntro {
  from { background-size: 0 200% }
  to { background-size: calc(var(--n)*1ch) 200% }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* ==========================================================================
   Media Queries
   ========================================================================== */
@media (hover: none) {
  .gallery-images figure:hover {
    transform: none;
  }
}

.footnotes {
  width: 100%;
  margin-top: 40px;
  padding: 20px 0;
}

.footnotes p {
  margin: 15px 0;
  line-height: 1.4;
  text-indent: -20px;
  padding-left: 20px;
  font-size: 0.8rem;
  color: #666666;
}

/* Remove unwanted white boxes */
.nav-links,
.header-icons {
  background: transparent;
  box-shadow: none;
}

.nav-links.active {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

/* Typing Animation Section */
.typing-container {
  margin: 70px 0 50px;
  position: relative;
  max-width: var(--max-width);
  padding: 0 var(--padding-x);
}

.typing-text {
  font-size: 3em;
  font-weight: 300;
  color: var(--primary-color);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
  animation: typing 2.8s steps(25) forwards;
}

/* Single cursor that appears after typing */
.typing-text::after {
  content: '';
  position: absolute;
  right: 0;
  top: 15%;
  height: 80%;
  width: 3px;
  background: var(--primary-color);
  animation: blink 0.9s infinite;
  animation-delay: 2.7s; /* Start blinking after typing finishes */
}

/* Large screens */
@media (max-width: 1200px) {
  :root {
    --site-max-width: 100%;
    --content-width: 100%;
    --max-width: 100%;
  }

  /* Layout */
  .two-column-layout {
    flex-direction: column;
    gap: 1rem;
  }

  .project-content,
  .project-gallery,
  .content-column,
  .image-column {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    flex: 0 0 100%;
    padding-right: 0;
  }

  /* Typography */
  h1, .typing-text {
    font-size: 2.5em;
  }

  .greeting {
    font-size: 6rem;
  }

  .name {
    font-size: 5rem;
    margin-left: 30px;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  /* Components */
  .three-column-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-box {
    margin: 15px 0 25px;
    padding: 15px;
  }

  .intro-box-content {
    font-size: 1rem;
  }

  .intro-box-title {
    font-size: 1.1rem;
  }
}

/* Medium screens */
@media (max-width: 1024px) {
  :root {
    --padding-x: 8px;
  }
}

@media (max-width: 850px) {
  @keyframes typing {
    from { width: 0 }
    to { width: 100% }
  }
}

/* Tablet and mobile */
@media (max-width: 768px) {
  /* Root variables */
  :root {
    --padding-x: 8px;
    --nav-height: 60px;
  }

  /* Typography */
  body {
    padding-top: var(--nav-height);
    font-size: 16px;
    line-height: 1.4;
  }

  h1 {
    font-size: 2rem;
    white-space: normal;
    word-wrap: break-word;
    animation: none;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3, .project-section h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
  }
  .nav-wrapper {
    height: 45px;
    background: transparent;
    backdrop-filter: blur(10px);
  }

  .nav-container {
    justify-content: space-between;
    padding: 0 var(--padding-x);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    width: auto;
    flex-direction: column;
    background: transparent;
    padding: 0 var(--padding-x);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: auto;
  }

  .nav-links a {
    display: block;
    padding: 0.25rem 0.5rem;
    text-align: right;
    font-size: 0.9rem;
    background: transparent;
  }

  .header-icons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
  }

  .mobile-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    cursor: pointer;
    order: 2; /* Move the mobile menu button to the end */
  }

  /* Typography adjustments */
  .typing-text {
    font-size: 3rem;
    white-space: normal;
    word-wrap: break-word;
    animation: none;
  }

  .typing-text::after {
    display: none;
  }

  .greeting {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
  }

  .name {
    font-size: 3.5rem;
    margin-left: 0;
    display: block;
    white-space: normal;
    line-height: 1.2;
  }

  /* Content and Layout */
  .content-wrapper,
  .research-content {
    padding: 0 var(--padding-x);
  }

  .three-column-grid {
    grid-template-columns: 1fr;
  }

  /* Lists and Spacing */
  .content-block ul,
  .lab-section ul {
    margin: 10px 0 10px 20px;
    padding-left: 20px;
  }

  /* Components */
  .gallery-images {
    padding: 0.5rem;
  }

  .project-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
  }

  .image-item {
    margin-bottom: 15px;
  }
  .grid-item img,
    height: 250px;
  }
  .fun-photo-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .fun-grid-item img {
    height: 250px;
  }
  .image-item img {
    max-height: 300px;
  }

  .content-column img {
    max-height: 300px;
  }

  .image-item.circle img {
    width: 400px;
    height: 400px;
  }

  .image-caption,
  .grid-item figcaption,
  .fun-grid-item figcaption {
    font-size: 0.7rem;
    margin-top: 0.35rem;
    padding: 0 var(--padding-x);
  }

  .keywords {
    font-size: 0.75rem;
    margin: 20px 0 30px;
    padding: 0 var(--padding-x);
  }
}

/* Small screens */
@media (max-width: 480px) {
  :root {
    --padding-x: 8px;
  }
  .nav-wrapper {
    height: 40px;
    backdrop-filter: blur(10px);
    background: transparent;
  }

  .nav-links {
    top: 40px;
  }

  .nav-links a {
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
  }

  .header-icons {
    gap: 0.5rem;
  }

  .greeting {
    font-size: 4rem;
  }

  .name {
    font-size: 3.5rem;
    margin-left: 15px;
  }

  .content-block ul,
  .lab-section ul {
    margin: 8px 0 8px 15px;
    padding-left: 15px;
  }

  .grid-item img {
    height: 200px;
  }

  .image-item img,
  .content-column img {
    max-height: 250px;
  }

  .image-item.circle img {
    width: 300px;
    height: 300px;
  }
  .image-caption,
  .grid-item figcaption,
  .fun-grid-item figcaption {
    font-size: 0.65rem;
    margin-top: 0.25rem;
  }
  .fun-photo-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .fun-grid-item img {
    height: 250px;
  }

  .keywords {
    font-size: 0.7rem;
    margin: 15px 0 25px;
  }
}

/* Mobile menu button styling */
.mobile-menu-button {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
  margin: 0;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  font-size: 1.5rem;
  color: var(--accent-color);
  order: 2; /* Move the mobile menu button to the end */
}

.mobile-menu-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.mobile-menu-button:active {
  background-color: rgba(0, 0, 0, 0.1);
}

.section-title {
  font-size: 2rem;
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
  color: var(--primary-color);
}

/* Large screens */
@media (max-width: 1200px) {
  :root {
    --site-max-width: 95%;
    --content-width: 90%;
    --max-width: 100%;
  }

  /* Layout */
  .two-column-layout {
    flex-direction: column;
    gap: 1rem;
  }

  .project-content,
  .project-gallery,
  .content-column,
  .image-column {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    flex: 0 0 100%;
    padding-right: 0;
  }

  /* Typography */
  h1, .typing-text {
    font-size: 2.5em;
  }

  .greeting {
    font-size: 6rem;
  }

  .name {
    font-size: 5rem;
    margin-left: 30px;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  /* Components */
  .three-column-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .intro-box {
    margin: 8px 0 15px;
    padding: 15px;
  }

  .intro-box-content {
    font-size: 1rem;
  }

  .intro-box-title {
    font-size: 1.1rem;
  }
}

/* Medium screens */
@media (max-width: 1024px) {
  :root {
    --padding-x: 8px;
  }
}

@media (max-width: 850px) {
  @keyframes typing {
    from { width: 0 }
    to { width: 100% }
  }
}

/* Tablet and mobile */
@media (max-width: 768px) {
  /* Root variables */
  :root {
    --padding-x: 8px;
    --nav-height: 60px;
  }

  /* Typography */
  body {
    padding-top: var(--nav-height);
    font-size: 16px;
    line-height: 1.4;
  }

  h1, .typing-text {
    font-size: 2rem;
    white-space: normal;
    word-wrap: break-word;
    animation: none;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3, .project-section h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
  }
  .nav-wrapper {
    height: 45px;
    background: transparent;
    backdrop-filter: blur(10px);
  }

  .nav-container {
    justify-content: space-between;
    padding: 0 var(--padding-x);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    width: auto;
    flex-direction: column;
    background: transparent;
    padding: 0;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: auto;
  }

  .nav-links a {
    display: block;
    padding: 0.25rem 0.5rem;
    text-align: right;
    font-size: 0.9rem;
    background: transparent;
  }

  .header-icons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
  }

  .mobile-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    cursor: pointer;
    order: 2; /* Move the mobile menu button to the end */
  }

  /* Typography adjustments */
  .typing-text {
    font-size: 2rem;
    white-space: normal;
    word-wrap: break-word;
    animation: none;
  }

  .typing-text::after {
    display: none;
  }

  .greeting {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
  }

  .name {
    font-size: 3.5rem;
    margin-left: 0;
    display: block;
    white-space: normal;
    line-height: 1.2;
  }

  /* Content and Layout */
  .content-wrapper,
  .research-content {
    padding: 0 var(--padding-x);
  }

  .three-column-grid,
  .fun-photo-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .grid-item img,
  .fun-grid-item img {
    height: 250px;
  }

  /* Lists and Spacing */
  .content-block ul,
  .lab-section ul {
    margin: 10px 0 10px 20px;
    padding-left: 20px;
  }

  /* Components */
  .gallery-images {
    padding: 0.5rem;
  }

  .project-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
  }

  .image-item img,
  .content-column img {
    max-height: 300px;
  }

  .image-item.circle img {
    width: 300px;
    height: 300px;
  }
  .typing-text {
    white-space: normal;
    word-wrap: break-word;
    animation: none;
  }
}

/* Small screens */
@media (max-width: 480px) {
  :root {
    --nav-height: 60px;
    --padding-x: 8px;
  }
  .nav-wrapper {
    height: 40px;
    background: transparent;
    backdrop-filter: blur(10px);
  }
  .image-caption,
  .grid-item figcaption,
  .fun-grid-item figcaption {
    font-size: 0.65rem;
    margin-top: 0.25rem;
  }

  .keywords {
    font-size: 0.7rem;
    margin: 15px 0 25px;
  }

  .nav-links {
    top: 40px;
    background: transparent !important;
  }

  .nav-links a {
    padding: 0.2rem 0.4rem;
  }

  .header-icons {
    gap: 0.5rem;
  }

  .greeting {
    font-size: 4rem;
  }

  .name {
    font-size: 3.5rem;
    margin-left: 8px;
  }
  .name span:last-child {
    display: block;
    margin-top: 0.5rem;
  }

  .content-block ul,
  .lab-section ul {
    margin: 8px 0 8px 15px;
    padding-left: 15px;
  }
  .grid-item img,
  .fun-grid-item img {
    height: 200px;
  }
}


/* Special case for climbing image - second image in column */
.image-item:nth-child(2) img {
  max-height: 500px; /* Increased height for climbing image */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .image-item img {
    max-height: 300px;
  }

  .image-item:nth-child(2) img {
    max-height: 400px;
  }

  .image-item.circle img {
    width: 400px;
    height: 400px;
  }
}

@media (max-width: 480px) {
  .image-item img {
    max-height: 250px;
  }

  .image-item:nth-child(2) img {
    max-height: 350px;
  }

  .image-item.circle img {
    width: 350px;
    height: 350px;
  }
}
