@media (max-width: 600px) {
  .header-social-container-mobile {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.2em;
    margin-bottom: 0.2em;
    position: static;
  }
  .header-social-container-mobile .header-social {
    position: static !important;
    display: flex !important;
    flex-direction: row;
    gap: 0.7em;
    margin: 0;
    width: auto;
    background: none;
    z-index: 10;
  }
  .header-flex {
    flex-direction: column;
    align-items: center;
    gap: 0.2em;
  }
  .header-content > div {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5em !important;
    margin-top: 0.5em !important;
  }
  .project-subname {
    margin-left: 0 !important;
    font-size: 1em !important;
    text-align: left !important;
    align-self: center !important;
    margin-top: -7px !important;
    transform: translateY(-5px) !important;
    position: relative !important;
    top: -5px !important;
  }
  .header-social {
    position: absolute !important;
    right: 1.2em;
    top: 0.7em;
    display: flex !important;
    flex-direction: row;
    gap: 0.7em;
    margin: 0;
    width: auto;
    background: none;
    z-index: 10;
  }
  /* Mobile menu bar override (if needed) can go here */
  /* Compact mobile header bar and elements */
  .page-header {
    padding: 0.1em 0 0.1em 0 !important;
    min-height: 11em !important;
    max-height: 11em !important;
  }
  .header-social {
    position: absolute !important;
    right: 1.2em;
  /* nudge icons down ~10px and left ~5px on mobile to better align with menu */
  bottom: 0.7em;
  transform: translateY(10px) translateX(-5px);
    top: auto !important;
    z-index: 10;
  }
  .mobile-menu-btn {
    position: absolute !important;
    left: 50%;
  /* keep horizontal centering, nudge down further (~20px total) to align with social icons */
  transform: translateX(-50%) translateY(20px);
    bottom: 0.7em !important;
    margin: 0 !important;
    z-index: 11;
    transition: transform 0.3s ease, background-color 0.3s ease;
  }
  .mobile-menu-btn:hover {
    background-color: #4f46e5; /* Slightly darker shade for hover */
    transform: translateX(-50%) translateY(20px) scale(1.05); /* Ensure no horizontal shift */
  }
  .header-flex {
    gap: 0.1em !important;
  }
  .site-logo, .circular-logo {
    height: 4.2em !important;
    width: 4.2em !important;
    max-width: 30vw !important;
    margin-bottom: 0.1em !important;
    margin-top: 10px !important;
  }
  .header-content > div {
    margin-top: 0.1em !important;
    gap: 0.2em !important;
  }
  .page-header .project-name {
    font-size: 1.2em !important;
    margin-top: 10px !important;
    /* nudge title up ~10px on mobile for visual alignment */
    transform: translateY(-10px);
    margin-bottom: 0.1em !important;
    line-height: 1.1 !important;
  }
  .project-subname {
    font-size: 1.2em !important;
    margin-top: 0.2em !important;
    margin-bottom: 0.2em !important;
    margin-left: -50px !important;
    margin-top: 10px !important;
  }
  .project-subname {
    font-size: 0.8em !important;
    margin-top: -8px !important;
    top: -7px !important;
  }
  .header-social {
    margin-top: 0.1em !important;
    margin-bottom: 0 !important;
    gap: 0.3em !important;
  }
  .header-social img {
    width: 22px !important;
    height: 22px !important;
  }
  .mobile-menu-btn {
    font-size: 1.3em !important;
    padding: 0.2em 0.7em !important;
    /* remove the auto margin that pushes the button down on mobile; positioning handled via absolute bottom */
    margin: 0 !important;
  }
}
/* Slim custom footer style */
footer[style] {
  padding: 0.1em 0.2em 0.1em 0.2em !important;
  font-size: 0.7em !important;
}
/* Sticky nav bar always on top after header */
/* Sticky nav bar always on top after header */
/* Sticky nav bar always on top after header */
/* Menu bar stays in normal flow, not sticky */
/* Centered sticky nav for desktop */
/* Centered sticky nav inside header bar */
.sticky-nav {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  background: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
/* --- Cleaned: Logo and Page Header --- */
.page-header {
  padding: 0.15em 0 0.1em 0;
  text-align: center;
  display: flex;
  align-items: stretch;
  max-height: 7.5em;
  min-height: 7.5em;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-flex {
  display: flex;
  align-items: center;
  gap: 0.4em;
  width: 100%;
}
.site-logo {
  height: 100%;
  max-height: none;
  width: auto;
  object-fit: contain;
  display: block;
}
/* Circular logo helper */
.circular-logo {
  width: 4.6em;
  height: 4.6em;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
  display: inline-block;
}
.header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  height: 100%;
  /* margin-top removed to avoid moving menu bar */
}
.page-header .project-name {
  font-size: 1.05em;
  margin-bottom: 0.2em;
  line-height: 1.1;
  margin-top: 6px;
  font-family: 'Pacifico', cursive;
  letter-spacing: 0.08em;
  font-stretch: expanded;
}

#header-string-rolls {
  position: relative;
  top: 0px;
  z-index: 2; /* baseline beneath project-name but above other elements */
  opacity: 0.98;
  pointer-events: none;
  width: 150px;
  transform: translate(-72px, -4px) scale(1); /* move image 2px right to match new spool position */
  display: inline-block;
}
.page-header .project-name {
  position: relative;
  z-index: 20; /* ensure header text sits above the string */
  background: transparent;
}
.project-subname {
  margin-top: -7px;
  transform: translateY(-5px);
  position: relative;
  top: -5px;
}

@media (max-width: 700px) {
  #header-string-rolls { display: none; }
}
.page-header .project-tagline {
  font-size: 0.55em;
  margin-bottom: 0.2em;
}
@media (max-width: 600px) {
  .page-header {
    flex-direction: column;
    align-items: center;
    padding: 0.7em 0 0.4em 0;
    min-height: unset;
    max-height: unset;
  }
  .header-flex {
    flex-direction: column;
    align-items: center;
    gap: 0.3em;
    width: 100%;
  }
  .site-logo {
    height: 4.2em;
    max-width: 80vw;
    margin-bottom: 0.5em;
  }
  .header-content {
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .page-header .project-name {
    font-size: 1.2em;
    margin-top: -13px;
    margin-bottom: 0.1em;
  }
  .project-subname {
    font-size: 0.65em !important;
    text-align: center !important;
    margin-left: 0 !important;
    letter-spacing: 0.01em !important;
    top: -4px !important;
  }
  .sticky-nav {
    position: static !important;
    left: unset !important;
    transform: unset !important;
    width: 100% !important;
    margin: 0.5em 0 0 0 !important;
    text-align: center !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5em;
  }
  nav {
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    max-width: 100vw;
    margin: 0;
    padding: 0 1vw;
  }
  nav a {
    font-size: 1em;
    padding: 0.3em 0.7em;
    width: auto;
  }
  .lazy-gallery {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 1em;
  }
  .lazy-gallery img {
    width: 100%;
    aspect-ratio: 1/1;
    height: auto;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
    border: 3px solid #eee;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    background: #fff;
    margin: 0;
    padding: 6px;
    transition: box-shadow 0.2s, border-color 0.2s;
  }
  footer {
  font-size: 0.8em;
  padding: 0.2em 0.2em 0.2em 0.2em;
  }
  .sticky-nav {
    display: none !important;
  }
  .mobile-menu-btn {
    display: block !important;
    background: #6366f1;
    color: #fff;
    border: none;
    font-size: 1em;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    margin: 13px auto 0.2em auto;
    cursor: pointer;
  }
  .mobile-menu-list {
    display: none;
    flex-direction: column !important;
    align-items: center;
    background: #6366f1;
    border-radius: 8px;
    margin: 0.2em auto;
    padding: 0.4em 0;
    width: 90vw;
    box-shadow: 0 2px 12px rgba(99,102,241,0.12);
    z-index: 10001;
    position: relative;
  }
  .mobile-menu-list.open {
    display: flex !important;
    flex-direction: column !important;
  }
  .mobile-menu-list a {
    color: #fff !important;
    font-size: 0.9em;
    padding: 0.4em 0;
    text-align: center;
    width: 100%;
    text-decoration: none;
    border-bottom: 1px solid #7c83f7;
  }
  .mobile-menu-list a:last-child {
    border-bottom: none;
  }
}
/* Keep nav menu on one line and allow horizontal scroll on small screens */
nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5em;
  justify-content: flex-start;
  align-items: center;
  max-width: 1200px;
  margin: 0 0 1.5em 0;
  padding: 0 2vw;
}

nav a {
  display: inline-block;
  white-space: nowrap;
}
nav a.active {
  background: #e0e7ff;
  color: #222;
  font-weight: bold;
  border-radius: 4px;
  padding: 0.2em 0.7em;
  text-decoration: none;
}
/* Smooth fade-in for main content */
.container {
  animation: content-fadein 1.1s cubic-bezier(.4,1.7,.7,1);
}
@keyframes content-fadein {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Modern animated gradient background */
body {
  background: linear-gradient(120deg, #f8fafc 0%, #e0e7ff 50%, #f0fdfa 100%);
  min-height: 100vh;
  animation: bg-move 12s ease-in-out infinite alternate;
}
@keyframes bg-move {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Animated footer */
footer {
  display: block !important;
  opacity: 0;
  transform: translateY(30px);
  animation: footer-fadein 1.2s cubic-bezier(.4,1.7,.7,1) 0.5s forwards;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 99999;
  background: #fff;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
  padding-bottom: 0.5em;
}
@keyframes footer-fadein {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button and nav link hover effects */
nav a, .btn, button {
  transition: color 0.2s, background 0.2s, box-shadow 0.3s, transform 0.2s;
  border-radius: 6px;
  padding: 0.2em 0.7em;
  text-decoration: none;
  color: #fff;
}
nav a:hover, .btn:hover, button:hover {
  color: #fff;
  background: linear-gradient(90deg, #6366f1 0%, #06b6d4 100%);
  box-shadow: 0 2px 12px rgba(99,102,241,0.12);
  transform: translateY(-2px) scale(1.06);
}

/* Gallery image entrance animation */
.lazy-gallery a {
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  animation: gallery-fadein 0.7s cubic-bezier(.4,1.7,.7,1) forwards;
  animation-delay: calc(var(--i, 0) * 0.07s);
}
.lazy-gallery a.loaded {
  opacity: 1;
  transform: scale(1) translateY(0);
}
@keyframes gallery-fadein {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
/* Gallery image frame and spacing */
/* Gallery grid: 4 per row on desktop, responsive on mobile */
.lazy-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 1.5em;
}
.lazy-gallery a {
  display: block;
  box-sizing: border-box;
}
@media (max-width: 900px) {
  .lazy-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .lazy-gallery img {
    aspect-ratio: 1/1;
    height: auto;
    max-height: none;
    object-fit: cover;
  }
}
@media (max-width: 600px) {
  .lazy-gallery {
    grid-template-columns: 1fr;
  }
  .lazy-gallery img {
    aspect-ratio: 1/1;
    height: auto;
    max-height: none;
    object-fit: cover;
  }
}
.lazy-gallery img {
  border: 3px solid #eee;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  background: #fff;
  margin: 0;
  padding: 6px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.lazy-gallery img:hover {
  border-color: #b3c6ff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
/* Hide the GitHub Pages default footer message and Cayman theme's default footer */
footer[role="contentinfo"], .site-footer-owner, .site-footer-credits, .footer, .page-footer, .site-footer {
  display: none !important;
}

/* Always show our custom footer */
footer {
  display: block !important;
}

/* Zig-zag mission images layout */
.mission-zigzag {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  margin: 1.5em 0;
  position: relative;
}
.mission-img {
  width: 80px;
  height: auto;
  margin: 0 -10px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  position: relative;
  z-index: 1;
  transition: transform 0.2s;
}
.mission-img-left {
  transform: rotate(-8deg) translateY(0);
  z-index: 2;
}
.mission-img-right {
  transform: rotate(8deg) translateY(30px);
  z-index: 3;
}
.mission-img:hover {
  transform: scale(1.08) rotate(0deg);
  z-index: 10;
}
@media (max-width: 600px) {
  .mission-zigzag {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .mission-img {
    margin: 0 0 0.5em 0;
    width: 60px;
  }
}
