/* The site header (FAMILY-SPEC rule 7; Sol review r1, R5/R6), 2026-11-02.
   One stylesheet for the one header. The app's header (app/components/Chrome.js, imported last in app/layout.js) and
   /evaluate's static page (content/evaluate-improved.html, which does not render the app layout) both use this markup:
     <header class="… site-header"><div class="nav-in"><a class="brand">…</a><nav class="nav-links">…</nav>…</div></header>
   Each route keeps its own links; this file only draws them.

   The bar switches to its compact layout by a container query measured in em, not by a viewport width in px: the
   query is answered with the bar's own font size, which follows the reader's text size. At 200% text the links move
   behind the Menu (or the page's single header link), instead of running out of the bar and being clipped.

   Every rule carries :root … :not(#sh) so it sits above the older header rules in app/globals.css and
   app/styles/site-polish.css without !important. */

/* Glass (FAMILY-SPEC rule 13, 2026-11-11): the bar is dark verdigris glass in both appearances, the one header material
   of rule 7. Blur 20px and saturate 160%, a 1px hairline that is always on, a top highlight and a faint bottom shade.
   The fill is .70, not the brief's .26: in light appearance white sections and photographs scroll behind the bar, and
   .70 is what keeps its 14px links at 4.5:1 over pure white (measured, glass-contrast.js). The material is constant:
   nothing here depends on scroll. Fallbacks are at the end of this file. */
:root {
  --sh-glass-fill: rgba(13,33,27,.70); --sh-glass-blur: 20px; --sh-glass-sat: 160%;
  --sh-glass-border: rgba(158,205,184,.22); --sh-glass-rim: rgba(214,240,226,.20); --sh-glass-shade: rgba(0,0,0,.30);
  --sh-link: #d3e5db;
}

:root .site-header:not(#sh) .nav-in {
  container: site-nav / inline-size;
  box-sizing: border-box; display: flex; align-items: center; gap: 14px;
  width: min(1280px, 100% - 32px); max-width: 1280px; height: auto; min-height: 64px; margin-inline: auto; padding-inline: 18px;
  border: 1px solid var(--sh-glass-border); border-radius: 20px;
  background: var(--sh-glass-fill); color: #f1f8f4; font-size: 1rem;
  -webkit-backdrop-filter: blur(var(--sh-glass-blur)) saturate(var(--sh-glass-sat)); backdrop-filter: blur(var(--sh-glass-blur)) saturate(var(--sh-glass-sat));
  box-shadow: inset 0 1px 0 var(--sh-glass-rim), inset 0 -1px 0 var(--sh-glass-shade), 0 14px 36px -18px rgba(0,0,0,.5);
}
@media (max-width:760px) {
  :root .site-header:not(#sh) .nav-in { width: calc(100% - 20px); padding-inline: 12px; border-radius: 18px; }
}

/* The mark. The app shows the roundel and the SABINA wordmark; /evaluate keeps its lockup artwork, which carries the
   publisher line "by Dominus Foundry" (a protected publisher line, Sol r1 R4), at the sizes live uses. */
:root .site-header:not(#sh) .brand {
  display: flex; align-items: center; gap: 10px; flex: none; min-height: 44px; min-width: 44px;
  color: inherit; text-decoration: none;
}
:root .site-header:not(#sh) .brand img { width: 30px; height: 30px; object-fit: contain; }
:root .site-header:not(#sh) .brand span {
  font: 600 1.0625rem/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}
:root .site-header:not(#sh) .brand.lockup img { width: auto; height: 56px; }
@media (max-width:640px) { :root .site-header:not(#sh) .brand.lockup img { height: 46px; } }
@media (max-width:400px) { :root .site-header:not(#sh) .brand.lockup img { height: 40px; } }

/* Links: a 28px box, so fields scrolling under the bar are never covered by a full-height row of links (axe
   target-size), with the 44px hit area and the hover chip drawn by ::after (rule 3). */
:root .site-header:not(#sh) :is(.nav-links a, .nav-hire) {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px;
  border-radius: 999px; background: none;
  font: 500 .875rem/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0; text-transform: none; color: var(--sh-link); text-decoration: none; white-space: nowrap;
  transition: transform 100ms ease-out; /* rule 8: transform and opacity only */
}
:root .site-header:not(#sh) :is(.nav-links a, .nav-hire)::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%);
  border-radius: 999px; z-index: -1;
}
:root .site-header:not(#sh) :is(.nav-links a, .nav-hire):is(:hover, :focus-visible, [aria-current="page"]) { color: #f1f8f4; }
:root .site-header:not(#sh) :is(.nav-links a, .nav-hire):active::after { background: rgba(196,232,213,.12); }
@media (hover:hover) and (pointer:fine) {
  :root .site-header:not(#sh) :is(.nav-links a, .nav-hire):hover::after { background: rgba(196,232,213,.07); }
}
:root .site-header:not(#sh) :is(.nav-links a, .nav-hire, .brand):focus-visible { outline: 3px solid #87cbb0; outline-offset: 4px; }

/* A page whose header has a single link instead of a Menu (/evaluate) shows it only in the compact layout. These
   carry .nav-in so they outweigh the shared link rule above. */
:root .site-header:not(#sh) .nav-in .nav-hire { display: none; white-space: normal; min-width: 0; flex: 0 1 auto; text-align: right; }

/* Compact layout when the links do not fit. The query measures the bar's content box: 1242px when the bar is at its
   full 1280px. 77em (1232px at the default text size) keeps the app's link row exactly where it was (it already moves
   behind the Menu below 1340px, app/styles/site-polish.css); at larger text sizes the row moves behind the Menu
   sooner. A page with a shorter link row sets its own threshold (content/evaluate-improved.html). */
@container site-nav (max-width: 77em) {
  :root .site-header:not(#sh) .nav-links { display: none; }
  :root .site-header.pages:not(#sh) .nav-mid { display: flex; }
  :root .site-header:not(#sh) .menu-btn { display: grid; }
  :root .site-header:not(#sh) .nav-in .nav-hire { display: block; padding-block: 8px; } /* wraps whole, arrow included, at large text */
}

/* Glass fallbacks. No backdrop-filter: a near-opaque fill. Reduced transparency and more contrast: no blur, an opaque
   fill and a visible border. Print: no glass (the header is not printed by either page; this is belt and braces). */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --sh-glass-fill: rgba(13,33,27,.96); }
}
@media (prefers-reduced-transparency:reduce) {
  :root .site-header:not(#sh) .nav-in { background: #0d211b; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border-color: rgba(158,205,184,.4); }
}
@media print {
  :root .site-header:not(#sh) .nav-in { background: #0d211b; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
}
@media (prefers-contrast:more) {
  :root .site-header:not(#sh) .nav-in { background: #0d211b; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border-color: #99b6a8; }
  :root .site-header:not(#sh) :is(.nav-links a, .nav-hire) { color: #dfefe6; }
}
@media (prefers-reduced-motion:reduce) {
  :root .site-header:not(#sh) :is(.nav-links a, .nav-hire) { transition: none; }
}
