/* ===================================================================================================
   MASTHEAD  —  the sticky bar from Albumhound, Index by Ben, Atlas by Ben, and Countries Ranked, on its own.
   Self-contained: carries the variables, type, and motion it needs and nothing else. Drop it on any site, dark or not.

   Fonts (put in <head> before this file):
   <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Manrope:wght@500&family=Montserrat:wght@800&display=swap" rel="stylesheet">

   Markup:
   <header class="top">
     <div class="brand"><h1><span class="l">Site name</span></h1></div>
     <a class="mark" href="https://atlasbyben.com"><img class="mark-ico" src="atlas-compass.png" alt=""><span class="mark-w">Part of Atlas by Ben</span></a>
   </header>
   For a non-atlas site: href="https://indexben.com", src="index-mark.png", and the words "Part of Index by Ben".
   The mark is a bare link: an icon, then small grey caps, its last letter on the right axis. No pill, no box, no border.

   Two lines in the wordmark: a second <span class="l">. Long names shrink before they wrap (see .top h1 font-size).
   =================================================================================================== */
:root{
  --mh-navy:#020308;                  /* the bar: a shade above a black ground */
  --mh-rule:#182338;                  /* the hairline under it */
  --mh-ink-2:#a6adbf;                 /* the mark's words: cool grey */
  --mh-light-b:176,200,246;           /* the light's pale edge (rgb) */
  --mh-blue:94,142,226;               /* the wash that drifts across the bar (rgb) */
  --mh-ombre-mark:linear-gradient(135deg,#a9c6f7,#d3dcf4 52%,#eef0f4);   /* the wordmark: blue into ice */
  --mh-caps:"Montserrat",ui-sans-serif,system-ui,sans-serif;
  --mh-sans:"Manrope",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mh-axis:24px;                     /* the left edge and the right edge */
  --mh-measure:9999px;                /* set to the page's content width (e.g. 1168px) to keep the bar's text on the page's axes on a wide window; 9999px means full width */
}

.top{position:sticky;top:0;z-index:60;background:var(--mh-navy);overflow:hidden;isolation:isolate;transform:translateZ(0);color:#fff;
  border-bottom:1px solid var(--mh-rule);border-image:linear-gradient(90deg,rgba(var(--mh-blue),.15),rgba(var(--mh-blue),.75) 28%,rgba(var(--mh-light-b),.7) 72%,rgba(var(--mh-light-b),.15)) 1;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:calc(12px + env(safe-area-inset-top,0px)) max(var(--mh-axis),calc(50% - var(--mh-measure) / 2 + var(--mh-axis))) 12px}
.top::before{content:"";position:absolute;top:0;bottom:0;left:0;width:220%;z-index:-1;pointer-events:none;will-change:transform;   /* the wash: a sheet of the light slid across the bar, there and back, over most of a minute */
  background:linear-gradient(118deg,rgba(var(--mh-blue),.24),rgba(5,9,18,0) 46%,rgba(var(--mh-light-b),.12) 100%);animation:mh-wash 46s ease-in-out infinite}
@keyframes mh-wash{0%{transform:translateX(0)}50%{transform:translateX(-54.5%)}100%{transform:translateX(0)}}

.top .brand{flex:1 1 auto;min-width:0}
.top h1{margin:0;font-family:var(--mh-caps);font-weight:800;font-size:clamp(13px,4.1vw,17px);letter-spacing:.06em;text-transform:uppercase;line-height:1.3;white-space:nowrap;
  background:var(--mh-ombre-mark);-webkit-background-clip:text;background-clip:text;color:transparent;padding:.12em .1em .3em 0;margin:-.12em 0 -.3em;
  background-size:220% 100%;animation:mh-wordsweep 38s steps(190) infinite}   /* the wordmark's own sweep drifts, ten repaints a second */
.top h1 .l{display:block}
@keyframes mh-wordsweep{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}

.top .mark{flex:none;display:inline-flex;align-items:center;gap:6px;align-self:flex-end;height:24px;color:var(--mh-ink-2);text-decoration:none;white-space:nowrap;-webkit-tap-highlight-color:transparent;transition:color 1.1s ease}
.top .mark:hover,.top .mark:focus-visible{color:#eae6dc}
.top .mark-w{font-family:var(--mh-sans);font-weight:500;font-size:10px;letter-spacing:.08em;text-transform:uppercase;line-height:1}
.top .mark-ico{flex:none;display:block;width:18px;height:18px}
@media (max-width:560px){.top .mark-w{display:none}}   /* on a narrow phone the mark is the icon alone */

@media (prefers-reduced-motion:reduce){.top::before,.top h1{animation:none}}
