/* Site header shared by the static landing pages (/, /yield, /monitor).
   Design: the FerroNav bar from the original landing (src/components/ferro-nav.css) - cobalt mark and
   wordmark, a light "/" divider, links with a sliding highlight pill, the glowing cobalt CTA - made
   static on a white bar and finished like the page's cards (hairline edge, top highlight, soft shadow).
   Rhythm: an 8px grid on 36px controls. The bar stays 64px tall; the hero and scroll maths depend on it. */

.top {
  --hdr-ink: var(--ink);
  --hdr-muted: #5b606c;
  --hdr-edge: rgba(30, 42, 68, 0.10);
  --hdr-surface-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(14, 22, 38, 0.05), 0 4px 14px -6px rgba(14, 22, 38, 0.10);
  position: sticky; top: 0; z-index: 20;
  background: #fff;
  box-shadow: 0 10px 30px -24px rgba(14, 22, 38, 0.35);
  font-feature-settings: "ss01" on;
}
/* A bottom hairline that fades out at both ends instead of a hard full-width rule. */
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hdr-edge) 18%, var(--hdr-edge) 82%, transparent); pointer-events: none; }
.top .wrap { display: flex; align-items: center; height: 64px; }

/* brand + divider */
.brand { display: flex; align-items: center; gap: 9px; flex: none; color: var(--hdr-ink); font-size: 17px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
.brand .mark { display: block; flex: none; width: 28px; height: 28px; color: #2858ea; }
.brand .mark svg { display: block; width: 28px; height: 28px; }
.top .divider { margin: 0 14px 0 18px; color: rgba(30, 42, 68, 0.22); font-size: 20px; font-weight: 300; line-height: 1; transform: translateY(-1px); user-select: none; }

/* links: muted until hovered or current; the pill rests on the current page and follows the pointer */
.switch { position: relative; display: flex; align-items: center; gap: 2px; }
.switch a { position: relative; z-index: 1; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 9px; color: var(--hdr-muted); font-size: 13.5px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap; transition: color .18s ease; }
.switch a:hover, .switch a[aria-current="page"] { color: var(--hdr-ink); }
.switch .hl { position: absolute; top: 0; left: 0; z-index: 0; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px var(--hdr-edge), 0 1px 2px rgba(14, 22, 38, 0.05), 0 4px 12px -6px rgba(14, 22, 38, 0.14); pointer-events: none; opacity: 0; transition: transform .2s cubic-bezier(.22, 1, .36, 1), width .2s cubic-bezier(.22, 1, .36, 1), opacity .2s ease; }
/* Without the script the current page still reads as current. */
html:not(.hl-ready) .switch a.on { background: #fff; box-shadow: inset 0 0 0 1px var(--hdr-edge); }
.top a:focus-visible, .top button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* actions: a quiet text link, one outlined button, one solid CTA */
.cta-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cta-group .text-link { display: inline-flex; align-items: center; height: 36px; padding: 0 10px; border-radius: 9px; color: var(--hdr-muted); font-size: 13.5px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap; transition: color .18s ease; }
.cta-group .text-link:hover { color: var(--hdr-ink); }
.cta-group .ghost { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 12px; border-radius: 10px; background: #fff; color: var(--hdr-ink); font-size: 13px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--hdr-edge), var(--hdr-surface-shadow); transition: box-shadow .18s ease, transform .18s ease; }
.cta-group .ghost:hover { box-shadow: inset 0 0 0 1px rgba(30, 42, 68, 0.18), 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 2px 4px rgba(14, 22, 38, 0.06), 0 8px 18px -8px rgba(14, 22, 38, 0.18); }
.cta-group .ghost svg { width: 14px; height: 14px; color: var(--hdr-muted); }
.cta-group [data-wallet], .cta-group .go { margin-left: 4px; }   /* 12px before the primary action */
/* The CTA keeps each page's accent (--action: cobalt on / and /monitor, the loan colour on /yield). */
.top .go, .top .wbtn:not(.on) {
  display: inline-flex; align-items: center; justify-content: center; gap: 0;
  min-height: 36px; height: 36px; padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--action) 70%, #fff); border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--action) 88%, #fff), var(--action));
  color: #fff; font: 500 13px var(--font-ui); letter-spacing: -0.005em;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.28), 0 1px 2px color-mix(in srgb, var(--action) 30%, transparent), 0 6px 18px -6px color-mix(in srgb, var(--action) 45%, transparent);
  transform: none; transition: filter .18s ease, box-shadow .18s ease;
}
.top .go:hover, .top .wbtn:not(.on):hover { background: linear-gradient(180deg, color-mix(in srgb, var(--action) 92%, #fff), var(--action-hover)); transform: none; }
.top .wbtn.on { height: 36px; padding: 0 12px 0 8px; border: 0; border-radius: 10px; background: #fff; font-size: 13px; box-shadow: inset 0 0 0 1px var(--hdr-edge), var(--hdr-surface-shadow); }

@media (max-width: 900px) {
  .top .divider { margin: 0 8px 0 12px; }
  .cta-group .text-link { display: none; }   /* Lite paper drops first; Dashboard stays */
}
@media (max-width: 560px) {
  /* Phones: mark only (wallet.css drops the name), Dashboard as an icon, so everything fits at 360px. */
  .top .wrap { padding: 0 14px; }
  .top .divider { display: none; }
  .switch { gap: 0; margin-left: 6px; }
  .switch a { padding: 0 8px; }
  .cta-group { gap: 6px; }
  .cta-group [data-wallet], .cta-group .go { margin-left: 0; }
  .cta-group .ghost.app { width: 36px; padding: 0; justify-content: center; }
  .cta-group .ghost.app span { display: none; }
  .top .wbtn:not(.on) { padding: 0 12px; }
  .top .wbtn .wb-long { display: none; }              /* "Connect wallet" -> "Connect" */
}
@media (max-width: 380px) {
  .top .wrap { padding: 0 10px; }
  .switch a { padding: 0 6px; font-size: 13px; }
  .brand .mark, .brand .mark svg { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) { .switch .hl { transition: none; } }
