/* One masthead and reading surface for the map, articles, and resume. */
:root { --site-header-height: 104px; }
.site-header {
  position: fixed;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 28px 32px;
  background: var(--bg);
  z-index: 100;
}
.home .site-header { background: transparent; }
.site-header .map-title { line-height: 1.35; }
.site-header .map-title span { white-space: nowrap; }
.site-header .map-nav { margin: 0; }
.site-header .map-nav a { border: 1px solid transparent; }
.site-header .map-nav a:hover,
.site-header .map-nav a[aria-current="page"] { border-color: var(--border-strong); color: var(--text-primary); }
body.subpage { padding-top: calc(var(--site-header-height) + 16px); }
.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  transform: translateY(-200%);
  z-index: 300;
  padding: 10px 16px;
  color: var(--text-primary);
  background: var(--bg-card);
  font-family: var(--font-display);
}
.skip-link:focus { transform: none; }
:is(a, button, summary, [tabindex="0"]):focus-visible { outline: 2px solid var(--text-primary); outline-offset: 4px; }
.peak-hit-target:focus-visible {
  outline: none;
  stroke: var(--text-primary);
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}
.popover { margin: 0; padding: 0; left: auto; bottom: auto; max-width: calc(100vw - 40px); color: var(--text-primary); }
.popover::backdrop { background: rgb(0 0 0 / 14%); }
.popover-header h2:focus { outline: none; }
.popover-body { overscroll-behavior: contain; min-height: 0; }
.popover-close { width: 40px; height: 40px; }
.mobile-peak-item { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--text-primary); text-align: left; font: inherit; }
.mobile-peak-item > span { display: block; }
.mobile-peak-info > span { display: block; }
.post-bg-contours, .blog-bg-contours {
  /* Keep the paper clear behind text; contour detail lives in the margins. */
  mask-image: linear-gradient(to right, #000, transparent calc(50% - 400px), transparent calc(50% + 400px), #000);
  -webkit-mask-image: linear-gradient(to right, #000, transparent calc(50% - 400px), transparent calc(50% + 400px), #000);
}
.post-body a { overflow-wrap: anywhere; }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
@media (min-width: 769px) and (max-width: 960px) {
  :root { --site-header-height: 156px; }
}
@media (max-width: 768px) {
  :root { --site-header-height: 148px; }
  .site-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
  }
  .home .site-header { background: var(--bg); }
  .site-header .map-title { font-size: 32px; }
  .site-header .map-title span { display: block; margin: 4px 0 0; font-size: 14px; line-height: 1.4; letter-spacing: .01em; }
  .site-header .map-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .site-header .map-nav.theme-nav { grid-template-columns: 32px repeat(4, minmax(0, 1fr)); }
  .site-header .map-nav a { padding: 12px 2px; text-align: center; font-size: 12px; line-height: 18px; min-height: 44px; }
  body.home { padding-top: var(--site-header-height); }
  .popover { left: 0; top: auto; bottom: 0; max-width: none; }
  body.subpage { padding-top: calc(var(--site-header-height) + 16px); }
  .blog-list-item { gap: 12px; }
  .blog-list-peak { width: 24px; height: 24px; }
  .blog-list-content { min-width: 0; }
  .post-bg-contours, .blog-bg-contours { opacity: .2; mask-image: none; -webkit-mask-image: none; }
}
@media (max-width: 768px) {
  .compact-site-header {
    flex-flow: row nowrap;
    align-items: center;
    padding: 6px 16px;
  }
  .compact-site-header .map-title { font-size: 24px; }
  .compact-site-header .map-title span { display: none; }
  .site-menu-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
  }
  .site-menu {
    position: absolute;
    top: 100%;
    right: 8px;
    width: min(320px, calc(100vw - 16px));
    max-height: calc(100dvh - var(--site-header-height) - 8px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    box-shadow: 0 8px 20px rgb(0 0 0 / 10%);
  }
  .site-menu .map-nav { display: flex; flex-wrap: wrap; justify-content: space-around; }
  .site-menu .map-nav a { padding-inline: 4px; }
  .site-menu nav[aria-label="Table of contents"] {
    border-top: 1px solid var(--border);
    padding-top: 8px;
    font: 14px/1.4 var(--font-display);
  }
  .site-menu ul { list-style: none; margin: 0; padding: 0; }
  .site-menu ul ul { padding-left: 12px; }
  .site-menu li a { display: block; padding: 12px 8px; color: var(--text-secondary); text-decoration: none; }
  .site-menu li a[aria-current="location"] { font-weight: bold; color: var(--text-primary); }
  body:has(.compact-site-header) { --post-nav-height: 0px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
  .site-header, .skip-link, .post-bg-contours, .blog-bg-contours { display: none !important; }
  body.subpage { padding-top: 0; }
}
