/* Keep the archive controls and original navigation together as they wrap. */
html {
  scroll-padding-top: 180px;
}
body {
  overflow-x: clip;
}
.legacy-navigation {
  position: sticky;
  top: 0;
  z-index: 11000;
}
.legacy-return-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 10px max(20px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid #35435a;
  background: #171e29;
  color: #f1f4fa;
  font:
    13px/1.5 system-ui,
    sans-serif;
}
.legacy-return-label {
  color: #b8c5d9;
}
.legacy-return-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.legacy-return-bar a {
  color: #b9d2ff;
  text-decoration: none;
}
.legacy-return-bar a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.legacy-return-bar .legacy-return-home {
  border: 1px solid #536c91;
  border-radius: 5px;
  padding: 7px 12px;
  color: #f1f4fa;
  font-weight: 600;
}
.legacy-return-bar a:focus-visible {
  outline: 3px solid #b9d2ff;
  outline-offset: 3px;
}
.legacy-navigation .navbar {
  position: relative;
  top: auto;
}
.legacy-navigation + .section {
  margin-top: 0;
}
.switch input:focus-visible + .slider {
  outline: 3px solid var(--link-focus);
  outline-offset: 4px;
}
.code-panel {
  padding-top: 150px;
}
.code-panel .close-btn {
  border: 0;
  background: transparent;
  color: inherit;
}

/* Keep the original menu usable below the width needed for all seven links. */
@media (max-width: 1100px) {
  .navbar .hamburger-button {
    display: flex;
    margin-right: 12px;
  }
  .navbar .nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: min(300px, 100vw);
    height: auto;
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    padding: 18px;
    overflow-y: auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    transform: translateX(100%);
    visibility: hidden;
  }
  .navbar .nav-menu.active {
    transform: translateX(0);
    visibility: visible;
  }
  .navbar .nav-menu li {
    width: 100%;
  }
  .navbar .nav-menu a {
    padding: 10px 12px;
    font-size: 1rem;
  }
}
@media (max-width: 600px) {
  .legacy-return-bar {
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    text-align: center;
  }
  .legacy-return-label {
    width: 100%;
    font-size: 12px;
  }
  .legacy-return-links {
    justify-content: center;
    gap: 10px 16px;
  }
  .navbar {
    padding-inline: 12px;
  }
  .nav-brand .site-name {
    margin-right: 6px;
  }
  .contact-card a {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav-menu,
  .hamburger-line,
  .slider,
  .slider:before,
  .project-card {
    transition: none;
  }
}
