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;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 0 0 -4px;
  padding: 0;
  color: #e6c480;
  text-decoration: none;
}
.site-header .brand svg { display: block; width: 36px; height: 40px; fill: #e6c480; }
.site-links {
  display: grid;
  grid-template-columns: repeat(7, 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; }
.site-header a:focus-visible, .site-header summary:focus-visible { outline: 2px solid #e6c480; outline-offset: 2px; border-radius: 2px; }

/* The acquisition page keeps content discoverable without competing with signup. */
.home-header { height: 88px; }
.home-header .home-brand { width: auto; gap: 10px; font-family: "Figtree", Helvetica, Arial, sans-serif; font-size: 22px; color: #e6c480; }
.home-brand > span { display: inline-block; white-space: nowrap; }
.home-links { display: flex; align-items: center; gap: 12px; }
.home-links > a, .home-menu summary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 8px; color: #c0b3ca; cursor: pointer; list-style: none; }
.home-menu summary::-webkit-details-marker { display: none; }
.home-links a:hover, .home-menu summary:hover { color: #e6c480; }
.home-menu { position: relative; }
.home-menu-panel { position: absolute; z-index: 2; top: calc(100% + 8px); right: 0; display: flex; flex-direction: column; width: 230px; padding: 8px; border: 1px solid #49364f; border-radius: 12px; background: #21162b; }
.home-menu-panel a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: #c0b3ca; }
.home-menu-panel a:hover { background: #382442; }

@media (max-width: 760px) {
  .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; }
}
@media (max-height: 520px) {
  .site-header { height: 72px; }
}
@media (max-width: 600px) {
  /* One row, one control: the seven links collapse into a dropdown panel
     instead of a two-row grid, so the bar stays single-height on phones. */
  .site-header { height: 84px; }
  .site-links { flex: none; grid-template-columns: none; gap: 0; margin-right: -4px; }
  .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; }
  .home-header { height: 72px; gap: 8px; }
  .home-header .home-brand { font-size: 19px; gap: 6px; }
  .home-header .home-brand svg { width: 24px; height: 30px; }
  .home-links { gap: 2px; }
  .home-links > a, .home-menu summary { padding-inline: 6px; }
}
@media (max-width: 430px) {
  .home-header .home-brand { font-size: 17px; gap: 4px; }
  .home-header .home-brand svg { width: 22px; height: 28px; }
  .home-links { gap: 0; }
  .home-links > a, .home-menu summary { padding-inline: 4px; }
}
/* Four 44px links leave no room for the wordmark: keep the mark, as the shared
   header does; the link keeps its "Carthagent home" accessible name. */
@media (max-width: 389px) {
  .home-header .home-brand { width: 44px; }
  .home-header .home-brand > span { display: none; }
  .home-header .home-brand svg { width: 32px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-links a { transition: none; }
}
@media print {
  .site-header { display: none; }
}
