html { scrollbar-gutter: stable; scrollbar-color: #3a2a45 #160e20; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a2a45; border: 3px solid #160e20; border-radius: 8px; }
::-webkit-scrollbar-track { background: #160e20; }

.site-header {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 2 * clamp(20px, 3.4vw, 48px)));
  height: 104px;
  margin: 0 auto;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: normal;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: #49364f;
}
.site-header .brand {
  box-sizing: border-box;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 0 0 -4px;
  padding: 0;
  color: #e6c480;
  font-family: "Figtree", Helvetica, Arial, sans-serif;
  font-size: 22px;
  text-decoration: none;
}
.site-header .brand svg { display: block; flex: none; width: 36px; height: 40px; fill: #e6c480; }
.brand-name { display: inline-block; white-space: nowrap; font-weight: 600; letter-spacing: -.01em; }
.brand-name .wordmark-agent { font-style: italic; font-weight: 500; }
.site-links {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  align-items: center;
  gap: 0 16px;
  margin-right: -8px;
}
/* Desktop row: carries the original single-row geometry unchanged. */
.nav-row { display: contents; }
/* Narrow-screen dropdown: hidden everywhere the row fits. */
.nav-menu { display: none; }
.site-links a {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 8px;
  color: #c0b3ca;
  font: inherit;
  white-space: nowrap;
  text-decoration: none;
  transition: color .18s;
}
.site-links a:hover { color: #e6c480; }
.site-links a[aria-current="page"] { color: #f6f0e7; }
/* Sign in is a call to action: a filled gold pill, visible at every width. */
.site-links .nav-cta {
  margin-left: 8px;
  padding: 0 20px;
  border: 1px solid #e6c480;
  border-radius: 100px;
  background: #e6c480;
  color: #160e20;
  font-weight: 600;
  transition: background-color .18s, border-color .18s;
}
.site-links .nav-cta:hover, .site-links .nav-cta[aria-current="page"] { border-color: #f5dca9; background: #f5dca9; color: #160e20; }
.site-header a:focus-visible, .site-header summary:focus-visible { outline: 2px solid #e6c480; outline-offset: 2px; border-radius: 2px; }

@media (max-width: 900px) {
  .site-header .brand { font-size: 19px; gap: 8px; }
}
@media (max-width: 820px) {
  .site-header { height: 84px; gap: 16px; font-size: 13px; }
  .site-header .brand svg { width: 32px; height: 36px; }
  .site-links { gap: 0 4px; margin-right: -6px; }
  .site-links a { padding-inline: 6px; }
  .site-links .nav-cta { margin-left: 6px; padding-inline: 16px; }
}
@media (max-height: 520px) {
  .site-header { height: 72px; }
}
@media (max-width: 720px) {
  /* Below the width where the wordmark and the links share a row, the page
     links collapse into a dropdown panel. Sign in stays beside the toggle. */
  .site-header { height: 84px; }
  .site-links { flex: none; display: flex; gap: 8px; margin-right: -4px; }
  .site-links .nav-cta { margin-left: 0; }
  .nav-row { display: none; }
  .nav-menu { display: block; position: relative; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    color: #c0b3ca;
    cursor: pointer;
    list-style: none;
  }
  .nav-toggle::-webkit-details-marker { display: none; }
  .nav-toggle:hover { color: #e6c480; }
  .nav-bars { display: flex; flex-direction: column; gap: 5px; }
  .nav-bars i { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
  .nav-close { display: none; font-size: 26px; font-weight: 400; line-height: 1; }
  .nav-menu[open] .nav-bars { display: none; }
  .nav-menu[open] .nav-close { display: block; }
  .nav-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    /* Lift the panel above .site-header::after so the header hairline does not
       draw across the open menu. */
    z-index: 2;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    padding: 8px;
    border: 1px solid #49364f;
    border-radius: 12px;
    background: #21162b;
  }
  .nav-panel a { justify-content: flex-start; padding-inline: 14px; border-radius: 6px; }
  .nav-panel a:hover { background: #382442; }
}
/* The mark alone keeps the "Carthagent home" accessible name on tiny screens. */
@media (max-width: 389px) {
  .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .site-links a, .site-links .nav-cta { transition: none; }
}
@media print {
  .site-header { display: none; }
}
