.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
}

.mark {
  display: block;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 0;
  border: 1px solid var(--hair);
  background: var(--void);
}

.mark:hover { border-color: var(--phosphor); }
.mark img { display: block; width: 48px; height: 48px; object-fit: cover; object-position: center; }

:where(.topbar) nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
:where(.topbar) nav a { text-decoration: none; }
.topbar :is(.brand-link, .projects-popup__trigger) { color: inherit; }
.topbar :is(.brand-link, .projects-popup__trigger):hover { color: var(--phosphor); }
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 44px;
  min-width: 44px;
  padding: 0 6px;
  touch-action: manipulation;
}

.brand-icon { width: 1.05em; height: 1.05em; fill: currentColor; flex-shrink: 0; }

.docs-breadcrumb { color: var(--muted); font-size: var(--fs-small); }
.docs-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0 6px; list-style: none; margin: 0; padding: 0; }
.docs-breadcrumb li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.docs-breadcrumb .text-link { min-width: 44px; overflow-wrap: anywhere; }
.docs-breadcrumb [aria-current="page"] { color: var(--bright); font-weight: 600; }

/* Keep open panels above the mock controls and below the skip link. */
.topbar .projects-popup__panel { z-index: 61; }
body:has(.topbar) .skip-link { z-index: 62; }

body > footer {
  margin-block: clamp(48px, 7vw, 90px) 84px;
  padding: 0 0 32px;
  font-size: 13px;
}

body > footer .footer-inner {
  border-top: 1px solid var(--hair);
  padding-block: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  color: inherit;
  font-size: inherit;
}

body > footer p { margin: 0; }
body > footer a { display: inline-flex; align-items: center; justify-content: flex-start; min-height: 44px; padding-inline: 4px; color: inherit; }
body > footer a:hover { color: var(--phosphor); }

html[data-type] :is(.topbar, .projects-popup__panel, body > footer) {
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 400;
}

html[data-type] :is(.projects-popup__line, .projects-popup__footer) { font-size: var(--fs-small); }
html[data-type] .projects-popup__number { font-size: var(--fs-caption); }
html[data-type] .projects-popup__name { font: 600 18px/1.25 var(--head); }

/* Mid-width headers run out of space to the left of the Projects trigger. */
@media (min-width: 601px) and (max-width: 800px) {
  .topbar .projects-popup { position: static; }
  .topbar .projects-popup::before { display: none; }
}

@media (max-width: 700px) {
  .topbar { min-height: 78px; }
  :where(.topbar) nav { gap: 8px; font-size: 13px; }
  html[data-type] .topbar nav { font-size: var(--fs-small); }
}

@media (max-width: 620px) {
  .topbar { gap: 12px; }
  .mark { font-size: 13px; }
  body > footer .footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .topbar .projects-popup__list {
    max-height: calc(100vh - 156px);
    max-height: calc(100dvh - 156px);
  }
}

@media (max-width: 440px) {
  :where(.topbar) nav { gap: 6px; }
  .topbar .brand-link { padding-inline: 0; }
  .topbar .projects-popup__trigger { padding-inline: 3px; }
}

@media (max-width: 360px) {
  .topbar nav { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 16px; }
}

/* Header path trail (AUN-2152): "AunySillyMe.dev / Projects / lean-browser-use", the old site's header path. */
.topbar .header-trail { display: block; flex: 1 1 auto; min-width: 0; margin-right: auto; font: 400 15px/1.3 "JetBrains Mono", "JetBrains Mono Fallback", monospace; }
.header-trail ol { display: flex; align-items: center; min-width: 0; margin: 0; padding: 0; list-style: none; }
.header-trail li { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.header-trail li:last-child { flex: 0 1 auto; }
.header-trail a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.header-trail a:is(:hover, :focus-visible) { color: var(--phosphor); }
.header-trail a[aria-current="page"] { display: block; line-height: 44px; color: var(--bright); font-weight: 700; }
.header-trail__slash { padding-inline: 12px; color: var(--hair-strong, #3a5644); }
/* Narrow screens: the avatar already links home, so keep only the parent and the current page. */
@media (max-width: 900px) {
  .header-trail li:not(:nth-last-child(-n + 2)) { display: none; }
  .header-trail li:nth-last-child(2) .header-trail__slash { display: none; }
  .topbar > nav:not(.header-trail) { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
  .topbar .header-trail:has(li:only-child) { display: none; }
}
@media (max-width: 620px) {
  /* Phones: the trail takes its own row under the avatar and links, parent and current page. */
  .topbar { flex-wrap: wrap; row-gap: 0; padding-bottom: 6px; }
  .topbar .header-trail { order: 3; flex-basis: 100%; font-size: 13px; }
  .header-trail li:only-child .header-trail__slash { display: none; }
}
