/* ===========================================================================
   THE PAGE HEADER — one sheet, one look, every page.

   Markup: pages/SiteHeader.jsx (.header-container.site-header), rendered into
   the listing pages, statistics, About, the legal pages and the 404; plus the
   pared-down copy render/renderHostedJobs.js emits into the job-editor shell
   (.header-container, no .site-header — no rail, so it keeps its own auth pair
   and its big wordmark).

   WHY ITS OWN SHEET, IN ITS OWN UNITS
   The header used to live in global.css and size itself in `rem`. `rem`
   resolves against the DOCUMENT root, and the site hands different pages a
   different root: global.css steps it 16 → 14 → 13 → ~12 down the breakpoints,
   while html.statistics-page-html and html.company-page-html (the statistics
   page, the generated company / careers detail pages and the job editor) swap
   in a 3.6vw root below 600px. Same component, same markup — three different
   type sizes, which is what made the description read as a different font on
   every other page.

   So this sheet is ROOT-INDEPENDENT, the same trade styles/rail.css makes:

     • .header-container carries its OWN font-size, in px, following the
       listing pages' ladder exactly. The listing pages are the reference —
       nothing about them changes — and every other page now matches them
       whatever its root font is.
     • Everything inside is `em`, i.e. relative to that font-size, so the whole
       header steps down the ladder as one piece. Only LEAVES set a font-size
       of their own, so an em length never compounds — the one exception is
       .location-menu-item, and its padding is stated in its own em there.
     • The rail burger and the activity spinner stay in PX: they are rail
       controls and have to match the rail's own, which is px for this same
       reason.

   Loaded by pages/shared.jsx PageHead (so the legal pages and the 404 get it
   too) and by render/renderJobEditor.js, AFTER global.css. Nothing here needs
   global.css, but it does need to outrank it, and load order is what does it.
   =========================================================================== */

.header-container {
  /* THE HEADER'S OWN SCALE — see the note above. The steps are the listing
     pages' root ladder (global.css `html`): 16 at desktop and through the
     1300px step, then 14 / 13 / a viewport-proportional ~12. Every length
     below is em against this, so changing a step rescales the whole header. */
  font-size: 16px;
  /* Stated, not inherited: .statistics-page sets `font-family` on * (every
     descendant, directly — which beats inheritance), and the ja listing pages
     set it on .job-list-page. The header wears the same face on every page. */
  font-family: "Darker Grotesque", sans-serif;
  /* global.css's reset puts this on body; a header that carries its own type
     should carry its own leading with it. */
  line-height: 1;
  /* …and its own colour, for the third time the same argument: this component
     renders on FOUR surfaces and inherited its text colour from whichever sheet
     the page happened to load — #fff under global.css on the site, #ececec
     under chat.css's --text on the chat, the account pages and the whole
     employer host. Every element that states a colour of its own was already
     identical; this is for the ones that do not (the pickers' menu rows, and
     anything added here later), which were quietly two different greys
     depending on the page. */
  color: #fff;

  /* Shared with the rail toggle, which is positioned against this box and has
     to start where the padding does — an absolutely positioned child hangs off
     the PADDING box, so it would otherwise ignore this and ride the very top.
     The phone override below moves both together. */
  --header-pad-top: 0.5em;
  display: flex;
  /* 100% not 100vw: 100vw includes the vertical scrollbar, which on classic-
     scrollbar platforms (Windows/Linux) made every page ~12px wider than the
     viewport → a permanent horizontal scrollbar. Same fix on .Page,
     .Page-container and .about-parallax. border-box for the same reason: the
     rail toggle's gutter is padding on this box, and on content-box that width
     would be 100% PLUS the gutter. */
  width: 100%;
  box-sizing: border-box;
  /* The containing block for the burger and the spinner, both of which are
     taken out of flow and pinned to this box's top-right corner. */
  position: relative;
  flex-direction: row;
  /* ONE ROW, at every width (2026-08-19). This used to wrap, putting the whole
     block under the wordmark on a phone — see the note at .header-info for what
     gives instead now. */
  flex-wrap: nowrap;
  align-items: center;
  padding-top: var(--header-pad-top);
}
/* Japanese pages use the site's self-hosted JP face. Stated here rather than
   inherited from `html[lang="ja"] body`, for the same reason as the Latin face
   above. Its SIZE needs nothing here: the optical difference between the two
   faces is handled once, for the whole document, by --ja-optical in
   global.css — which is why the twelve hand-picked Japanese header sizes that
   used to follow this rule are gone. */
html[lang="ja"] .header-container {
  font-family: "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-synthesis: none;
}

/* The ladder. Mirrors global.css's `html` steps so the header lands on the
   listing pages' own sizes at every width — including on the pages whose root
   font goes its own way below 600px. (No 1300px step: the root holds 16px
   there too.) */
@media (max-width: 915px) {
  .header-container { font-size: 14px; }
}
@media (max-width: 755px) {
  .header-container { font-size: 13px; }
}
@media (max-width: 600px) {
  /* 2.353vw = 12px at 510px; `min` caps it so 510–600px stays put and the
     shrink starts at 510px, exactly as the root ladder does. */
  .header-container { font-size: min(12px, 2.353vw); }
}

/* The header that carries the rail toggle — every page of the site. The toggle
   is taken OUT of flow and pinned to the top-right, so it stays on the logo's
   row at every width. In flow it rode whichever row the text block landed on —
   which on a phone, where the header wraps, is the second one. The right
   padding is the gutter it sits in. The job-editor shell has no rail, so its
   header needs no gutter and is deliberately not in this rule. */
.site-header {
  /* Keep the listing-page accent even when chat.css supplies another brand. */
  --brand: orange;
  padding-right: 3em;
}
/* A generated detail page (functions/hostedJobsHtml.js detailPageFromListing —
   a crawled job, a company, a hosted posting) is a document: give the header a
   bottom rule so the chrome reads as chrome and the page starts below it. Full
   width — it is the header's edge, not the content column's. (The listing pages
   have a grid of cards under theirs, which draws that line for them.) */
/* …and the employer surface's own document-like views (pages/EmployerPage.jsx
   DETAIL_VIEWS — the job page, the company page, Overview). They draw the same
   detail markup and want the same chrome around it; they do NOT take
   company-page-html itself, which also swaps the root font below 600px for a
   page that is nothing but that content. */
/* …and an article (pages/Article.jsx), for the same reason. */
html.company-page-html .site-header,
html.employer-detail-html .site-header,
html.article-html .site-header {
  /* The same faint rule the "Explore related jobs" band draws at the foot of
     every page — a page's own dividers should be quieter than a card's. */
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.5em;
}

/* ---- the wordmark ------------------------------------------------------- */

/* The default is the job-editor shell's: there the header is most of the page,
   so the wordmark is the page's own mark and stays large. */
.header-logo {
  height: 6em;
  width: 24em;
  object-fit: contain;
}
.header-logo-wrap {
  padding-left: 1em;
  /* THE WORDMARK NEVER SHRINKS. As a plain flex item it would: the row does not
     wrap any more, so on a narrow phone the only way to fit an over-long
     address pair and a description was to squeeze the mark, and global.css's
     `img { max-width: 100% }` passed that squeeze straight through to the
     artwork — a wordmark rendering at a different size per page. The row takes
     its space out of the DESCRIPTION instead, which is what the icon is for. */
  flex: 0 0 auto;
}
/* The shared page header carries the wordmark above a page whose subject is
   what follows it, so it is a step smaller. 3em tall at the asset's 204×40
   ratio = 15.3em wide — state both so the box has no horizontal slack for
   object-fit to center in.
   The 0.5em the wordmark gave up comes back as padding on its wrap, so the
   logo's BAND stays 3.5em: that band is the header's height (.header-right's
   min-height) and what the rail toggle centres itself against, and neither
   should move just because the artwork got smaller. */
.site-header .header-logo {
  height: 3em;
  width: 15.3em;
}
.site-header .header-logo-wrap {
  padding-top: 0.25em;
  padding-bottom: 0.25em;
}

/* ---- the two blocks beside it ------------------------------------------- */

/* Everything to the right of the logo, as one row: .header-main plus the rail
   toggle at its right edge. It exists so those two wrap TOGETHER — as separate
   children of .header-container the toggle would be pushed onto a third line of
   its own on a phone, where .header-main already fills the second one. Centred,
   so the toggle sits on the same line as the logo, which .header-container
   centres against this block's height. */
.header-right {
  flex: 1 1 42em;
  display: flex;
  flex-direction: row;
  align-items: center;
  min-width: 0;
  /* Pinned to the logo's band (.header-logo, 3.5em), the tallest thing in the
     header: the row then keeps ONE height whatever the title and description
     happen to measure, everything in it centres on the logo's line, and the
     rail toggle's breathing room is a constant — exactly
     (3.5em − its 2.5em box) / 2 = the 0.5em it is inset by on the right.
     Keep the two values in step if either changes. */
  min-height: 3.5em;
}
.header-main {
  /* The 42em basis is what the two header groups (links+description |
     toggles+auth) need to sit side by side. When the space next to the logo
     drops below it, the whole block wraps to its own full-width row UNDER the
     logo (the .header-container wraps) — keeping the two groups side by side
     there, instead of the groups stacking while pinned beside the logo. On
     truly narrow screens the groups then stack within the row (see
     .header-top-row). The basis lives on .header-right too, since that is the
     box that actually wraps; here it also lets .header-main shrink by the
     toggle's width inside that row. */
  flex: 1 1 42em;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
/* Top header row: two groups — left is the address pair and the description
   beside it, right is whatever right-hand entries the page passes. Both
   centred, so they land on the same line as the logo and the rail toggle
   rather than hanging off the row's top.
   Responsive: nowrap keeps the two groups side by side at EVERY width — the
   left group (flex: 1 1 22em, min-width: 0) shrinks so its description wraps to
   more lines, rather than the right group dropping onto its own row. The right
   group (flex: 0 0 auto) never shrinks, so its entries stay intact. */
.header-top-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  column-gap: 0.5em;
  row-gap: 0.8em;
}
/* Left group of the top row: the location/section pickers and the description
   SIDE BY SIDE, pickers first. They wrap to two lines (pickers over text, the
   arrangement this block used to have outright) only whenever the description
   can no longer hold its 13em minimum beside them. */
.header-left {
  flex: 1 1 22em;
  min-width: 0;
  display: flex;
  flex-direction: row;
  /* The second of the two wrap points that are now off. The description used to
     land under the pickers here; it collapses to an icon instead. */
  flex-wrap: nowrap;
  /* Centred, not baseline-aligned: the title block is half again as tall as the
     description, so sharing a first-line baseline hung it well above the line
     the logo, the toggle and the description all sit on. The row gap only ever
     shows once the two wrap onto separate lines. */
  align-items: center;
  row-gap: 0.4em;
  min-width: 0;
  margin-left: 0.4em;
}

/* ---- the description ---------------------------------------------------- */

/* ---- the description, and the icon it collapses into --------------------- */

/* THE HEADER IS ONE ROW AT EVERY WIDTH (2026-08-19). It used to wrap twice —
   the whole block under the wordmark, and the description under the address
   pair — which is why the phone header was three stacked bands. Both wrap
   points are off (.header-container, .header-left); what gives instead is the
   DESCRIPTION, and it gives all at once rather than by degrees: below the width
   at which it is worth reading it is replaced by an info icon that shows it on
   hover or focus.

   THE SWAP IS DECIDED BY THE SPACE THE DESCRIPTION ACTUALLY HAS, not by the
   viewport. This box is a size CONTAINER and it is the row's only flexible
   item, so its inline size is exactly what the address pair and the controls
   left over — and the query below fires on that. A media query could not do
   this: the pair is a page's own name ("CHAT" against "ENGINEERING &
   INFRASTRUCTURE JOBS"), the rail is open on some visits and closed on others,
   and the same viewport therefore leaves quite different room on two pages.

   ⚠️ SEO. The <p> is server-rendered into every page and is in the HTML at
   every width — the icon state hides it and re-shows it in the popover, which
   is the SAME element, so there is one copy of the text and never a version
   built on interaction. Google indexes with the smartphone crawler, so this is
   the state that counts; collapsed-behind-a-control content is indexed normally
   as long as it is in the markup, which is the whole reason this is CSS and not
   a second string. Do not "fix" this by rendering the description twice, and do
   not move it into a title/aria-label — 27 of the 31 paths give the header a
   `pitch` of its own, so on most pages this is the only place that copy exists. */
.header-info {
  padding-left: 1em;
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  padding-right: 2em;
  /* The query container. */
  container-type: inline-size;
  container-name: header-info;
  /* NOT position: relative. The icon and its panel are pinned to the header's
     top-right corner beside the burger, so .header-container is the containing
     block they want — and `container-type` does not bring layout containment
     with it here (computed `contain` stays `none`), so leaving this static is
     all it takes. */
  /* Was 13em, which is what USED to force the wrap. It has to be able to shrink
     now — shrinking is the signal — and all the way to nothing, because the
     icon it hands over to is pinned out of this box entirely. */
  min-width: 0;
}
.header-info-container {
  /* Keeps the description to a readable measure instead of letting it stretch
     across the rest of the header beside the pickers. */
  max-width: 24em;
}
.header-info-desc {
  color: rgba(125, 125, 125, 1);
  font-size: 0.9em;
}
/* Keep the description's text left-aligned (it used flex-end back when it was a
   side-by-side box in the old header-row), and drop its left padding — the
   nav's own right padding is the gap between the two now.
   The basis is the block's MINIMUM, not its text width: sized from the text it
   would be wider than the space beside the pickers and take over the row
   (wrapping used to be decided before shrinking). Starting at 13em and growing
   into whatever is left keeps it beside them. */
.header-left .header-info {
  align-items: flex-start;
  padding-left: 0;
  flex: 1 1 13em;
}

/* The icon. Hidden while the text is shown — `display`, so it is out of the
   document entirely and cannot itself be the reason the text does not fit.

   IT IS PART OF THE PINNED RIGHT-HAND CLUSTER, not of the row it belongs to in
   the markup: it is a third control beside the burger and the spinner, takes
   the burger's whole geometry (same 40px box, same centre line, same PX — see
   the note at .header-rail-btn for why those are px), and sits one box in from
   it. The spinner moves one box further along, so the three read as one group.
   It stays a child of .header-info in the MARKUP because that is the box the
   container query measures, and a query applies to an element's DOM ancestors
   whatever its positioning. Taking it out of flow is also what lets .header-info
   shrink to nothing — the address pair gets that space on a phone. */
.header-info-btn {
  display: none;
  place-items: center;
  position: absolute;
  font-size: inherit;
  top: calc(var(--header-pad-top, 0.5em) + 1.75em);
  transform: translateY(-50%);
  right: calc(1em + 40px);
  width: 40px;
  height: 40px;
  padding: 0;
  color: #b4b4b4;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}
.header-info-btn:hover,
.header-info-btn:focus-visible {
  color: #ececec;
}
.header-info-btn svg {
  /* global.css's `svg { width: 72rem }` reaches in here exactly as it does into
     the burger. The glyph is a little inside the 40px box: it is a filled-ish
     outline where the burger is three thin bars, and matching them line for
     line made it read as the heavier of the two. */
  width: 26px;
  height: 26px;
}

/* 13em is the measure below which the description is not worth reading — the
   same figure this box used to hold as its minimum width, now the point where
   it hands over to the icon instead of squeezing. */
@container header-info (max-width: 13em) {
  .header-info-btn {
    display: grid;
  }
  /* The icon has taken the slot beside the burger, so the spinner moves to the
     next one. This only happens where the icon is actually drawn — on a wide
     header the two rules above never apply and the spinner stays flush against
     the burger, with no gap left for a control that is not there. */
  .header-loader {
    right: calc(1em + 80px);
  }
  /* The popover. Still the page's own <p>, moved out of the row rather than
     replaced: hidden with visibility rather than `display` so it can fade, and
     taken out of flow so a hidden one costs the row nothing.

     IT HANGS BELOW THE WHOLE HEADER, not part-way down it. It used to be
     pinned at `--header-pad-top + 3.9em`, which on a phone lands squarely on
     top of the page's own name — the header is one row now and that name wraps
     to three lines under the address pair, so the panel covered the very thing
     the reader had just tapped next to. `top: 100%` is the header's own bottom
     edge whatever it grew to, so the panel never sits on the header's content:
     it opens under the chrome, over the page, like the section menu does.

     ⚠️ The chat and the account pages render this header INSIDE their scrolling
     column (`.thread-scroll > .site-header`), so a panel hanging past the
     header's own box is at the mercy of that column's `overflow`. The
     empty-thread state shrink-wraps that column and used to clip the panel's
     bottom edge off — see the `body.is-empty-thread:not(.view-open)` rule in
     styles/chat.css, which is what lets all three surfaces share this one
     position. */
  .header-info-container {
    position: absolute;
    top: calc(100% + 0.4em);
    /* Anchored by its RIGHT edge to the same gutter the burger sits in — a
       panel growing rightward from there would leave the screen. */
    right: 1em;
    left: auto;
    /* Above the listing grid and the sticky filters sidebar beneath it. */
    z-index: 20;
    width: max-content;
    /* Percent of the header's padding box, NOT 100vw — vw counts the vertical
       scrollbar (the same trap .header-container documents), and border-box
       because the cap has to include this panel's own padding and rule. Without
       both it measured 17px wider than its cap and hung off the left edge. */
    box-sizing: border-box;
    /* 20em, not the full width it may have. The <p> ran edge to edge as two
       ~90-character lines, which is a banner rather than something to read;
       this is roughly a 45-character measure. */
    max-width: min(20em, calc(100% - 2em));
    padding: 0.85em 1em;
    /* The rail's furniture, in the header's em: near-black panel, hairline
       edge, one soft drop shadow (styles/rail.css --rail-bg / --rail-border /
       --rail-shadow). The old 50%-white rule and hard shadow read as a sticker
       taped over the header. */
    background-color: rgba(13, 13, 13, 1);
    border: 0.0625em solid rgba(255, 255, 255, 0.14);
    border-radius: 0.5em;
    box-shadow: 0 0.75em 2.5em rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.25em);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
  }
  /* The caret, so the panel reads as belonging to the icon rather than as a
     band that appeared under the header. It is a rotated square wearing two of
     the panel's own edges, and it is offset from the panel's RIGHT edge because
     that is the edge both boxes are anchored by:
       icon centre from the header's right edge = 1em + 40px + 20px
       panel's own right offset                 = 1em
       ⇒ 60px, with no em left in it. The phone block restates it because both
     numbers change there (see .header-info-btn). Keep the two in step. */
  .header-info-container {
    --info-caret-right: 60px;
  }
  .header-info-container::before {
    content: "";
    position: absolute;
    top: -0.31em;
    right: calc(var(--info-caret-right) - 0.3em);
    width: 0.6em;
    height: 0.6em;
    background-color: inherit;
    border-left: 0.0625em solid rgba(255, 255, 255, 0.14);
    border-top: 0.0625em solid rgba(255, 255, 255, 0.14);
    transform: rotate(45deg);
  }
  /* Hover for a pointer, focus for a keyboard — and for a TOUCH tap, which
     focuses the button and blurs it again on the next tap elsewhere. That is
     the whole interaction: no JS, so it works identically on the legal pages
     and the 404, which load none of the site's behaviour. */
  .header-info:hover .header-info-container,
  .header-info:focus-within .header-info-container {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .header-info-desc {
    /* The row's muted grey was right BESIDE the pickers, where it is one line of
       supporting text. In a panel it is the only thing on screen and has to be
       read, so it comes up to the rail's own label colour. */
    color: rgba(232, 232, 232, 1);
    font-size: 1em;
    /* Free of the row's single line now that it has a panel of its own. */
    line-height: 1.45;
  }
}

/* ---- the right-hand column ---------------------------------------------- */

/* Right column of the top row: the PROFILE action, then any `actions` entries
   under it — in their own line so they can't push each other around. */
.header-buttons-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 2em;
  padding-left: 1em;
  /* Never shrink below content; margin-left keeps the group pinned right both
     beside the left group and after wrapping onto its own row. */
  flex: 0 0 auto;
  margin-left: auto;
}
.header-buttons {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}
.rank-toggle {
  background-color: rgba(20, 20, 20, 1);
  padding-left: 1.2em;
  padding-right: 1.2em;
  padding-bottom: 0.5em;
  padding-top: 0;
  /* Inactive by default; globalfilters.js adds .rank-toggle--active to the
     selected ranking mode. (No page ships those toggles at the moment — the
     only .rank-toggle left in a header is the PROFILE action below, which
     styles itself active.) */
  opacity: 0.5;
  color: rgba(110, 110, 110, 1);
}
.rank-toggle--active {
  opacity: 1;
  color: var(--brand);
}
/* "PROFILE" header button (showProfileButton pages). It's an action, not a
   ranking toggle, so it always reads as active/clickable rather than greyed. */
.rank-toggle--profile {
  opacity: 1;
  color: var(--brand);
  cursor: pointer;
}
/* These were <h2>s and inherited `font-weight: bold` (and a font-size these
   rules then overrode) from the global h2 rule. They're buttons, not headings —
   a ranking toggle in every page's document outline made the outline
   unreadable to crawlers — so they're plain elements now and carry their own
   weight. */
.header-button {
  font-weight: bold;
  font-size: 2.4em;
}
@media (max-width: 1300px) {
  .header-button { font-size: 1.6em; }
}
/* The header's right-hand entry row: its own line, right-aligned by the
   .header-buttons-wrap column, plain text links styled like the section links
   rather than boxed buttons.
   `.header-nav-actions` is what pages/SiteHeader.jsx emits from its `actions`
   list — EMPTY on every page since 2026-08-16, when statistics dropped its
   "Browse jobs" + locale pair (the ja paths had already turned the locale
   switch off, the rail carrying it); kept as the seam for the next right-hand
   entry. `.header-nav-auth` survives for the job-editor shell's own header
   (render/renderHostedJobs.js), which has no rail and so still carries the
   Register / Log in pair the site's header dropped. */
.header-nav-actions,
.header-nav-auth {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2em 1.1em;
}
/* The header's entry labels: brand-orange bold, like the site's other
   nav/action labels (footer section links, About buttons), dimmed until
   hovered — the same treatment as the inactive rank-toggles. */
.header-nav-btn {
  font-size: 0.85em;
  font-weight: bold;
  color: var(--brand);
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.15s ease;
  /* The statistics page used to render real links here and needed this; kept
     so a future <a> entry reads like the <div> ones beside it. */
  text-decoration: none;
}
.header-nav-btn:hover,
.header-nav-btn:focus-visible {
  opacity: 1;
}

/* ---- the address pair (location over section) --------------------------- */

/* The section links stand in for the old "About ranking" header title, so they
   wear its style: brand-orange bold. The current section is full-strength; the
   rest are dimmed until hover. */
.site-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.2em 1.1em;
}
/* Placement: the pickers open the header's left group, with the description
   beside them (see .header-left). The right padding is the gap to that text. */
.header-nav {
  padding-left: 1em;
  padding-right: 2em;
  /* A page's own name is not negotiable: it never shrinks or truncates, so the
     description beside it is the only thing the row can take space from. That
     is what makes .header-info's own width a true reading of the space left. */
  flex: 0 0 auto;
  /* The two pickers STACK — location over section, both flush left — rather
     than sitting side by side on a baseline. They read as one address for the
     page that way (Tokyo, then what in Tokyo), and the pair is a compact block
     the description can sit beside. Their dropdowns are absolutely positioned
     off each picker, so stacking costs them nothing. */
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1em;
}
/* Both pickers are real <button>s (pages/SiteHeader.jsx): they open a menu, and
   a button is focusable and Enter/Space-operable on its own — which the legal
   pages and the 404 need, since they load no a11y.js to give a .pressable div
   those semantics. A button inherits none of the page's type, though, so the
   whole UA look has to be undone here: without font-family the labels drop out
   of the header's face into the platform's button one.
   NOTE it does not set font-size — .site-nav-link below does, and `em` in the
   font-size property resolves against the PARENT, so the UA's button size never
   enters into it. Setting it here as well would outrank that rule. */
button.site-nav-link {
  padding: 0;
  background: none;
  border: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.site-nav-link {
  /* Brand-orange bold like the footer's section links; the current section is
     full-strength, the rest dimmed until hover (the rank-toggle pattern). */
  color: var(--brand);
  opacity: 0.35;
  /* Stated, not inherited: a <button> takes `line-height: normal` from the UA
     sheet rather than the header's 1 — which made the statistics page's title
     block a good 16px taller than the listing pages' identical one. */
  line-height: 1;
  font-size: 0.85em;
  font-weight: bold;
  text-decoration: none;
  text-transform: uppercase;
  transition: opacity 0.15s ease;
}
.site-nav-link:hover,
.site-nav-link:focus-visible {
  opacity: 1;
}
.site-nav-link--current {
  opacity: 1;
}
.location-picker,
.section-picker {
  position: relative;
}
.header-section-heading {
  margin: 0;
  /* Preserve .site-nav-link weight and line-height for semantic H1 labels. */
  font-family: inherit;
}
.section-toggle {
  cursor: pointer;
}
/* Location picker at the left end of the nav row: white instead of the section
   links' orange (uppercase and bold are inherited from .site-nav-link). Only
   Tokyo exists for now, so its menu is a one-entry placeholder. */
.location-toggle {
  color: #fff;
  opacity: 1;
}
/* Stacked in the header, the pair is the page's address and gets to act like a
   title: the location leads at roughly twice the section's size, the section
   reads as its subtitle, and together they stand about as tall as the
   description beside them instead of floating as two small labels.
   Sized per context rather than once: the responsive and Japanese blocks below
   set .site-nav-link's size outright and outrank a .header-nav-scoped rule, so
   each place that does gets its own pair. */
.header-nav .location-toggle {
  font-size: 1.75em;
}
.header-nav .section-toggle {
  font-size: 1.05em;
}
.header-nav .header-section-heading {
  font-size: 1.05em;
}
/* The section picker reuses .location-menu / .location-menu-item for its
   dropdown; only the open-toggle selector differs.

   It wears the RAIL's furniture in the header's own em — near-black panel,
   hairline edge, rounded corners, one soft drop shadow (styles/rail.css
   --rail-bg / --rail-border / --rail-radius / --rail-shadow). The rail is the
   site's other list of destinations and sits a few hundred pixels away from
   this one; they should not be two different ideas of a menu. What this
   replaced — square corners, a 50%-white rule and a hard shadow — was neither
   the rail's look nor the cards'. */
.location-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5em);
  left: 0;
  z-index: 20;
  min-width: 7em;
  /* Padding on the PANEL rather than the items, so a hovered row's fill stops
     short of the edge instead of running into the border. */
  padding: 0.3em;
  background-color: rgba(13, 13, 13, 1);
  border: 0.0625em solid rgba(255, 255, 255, 0.14);
  border-radius: 0.5em;
  box-shadow: 0 0.75em 2.5em rgba(0, 0, 0, 0.55);
}
.location-picker.open .location-menu,
.section-picker.open .section-menu {
  display: block;
}
/* The one element in this sheet that sets a font-size AND carries lengths, so
   its padding is em of ITS size, not the header's: 0.4/0.8 here is the
   0.34/0.68 of the header's em that the rest of the sheet is written in. */
.location-menu-item {
  display: block;            /* section items are <a> links — fill the row */
  padding: 0.4em 0.8em;
  font-size: 0.85em;
  font-weight: bold;
  white-space: nowrap;       /* keep "Software & IT" on one line */
  /* The rail's label white, dimmed — these are destinations, and the rail
     learned the hard way that a column of greys reads as disabled. */
  color: rgba(255, 255, 255, 0.72);
  border-radius: 0.3em;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.location-menu-item:hover,
.location-menu-item:focus-visible {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}
/* The entry you are already on, in the colour of the TOGGLE its menu hangs
   from — the same word in the same colour above and below, so a menu reads as
   that control opened rather than as a separate list. The location picker is
   white (.location-toggle) and the section picker is brand orange
   (.site-nav-link), so this is stated twice rather than once. */
.location-menu-item--current {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}
.location-menu-item--current:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.14);
}
.section-menu .location-menu-item--current {
  color: var(--brand);
  background-color: rgba(255, 133, 0, 0.1);
}
.section-menu .location-menu-item--current:hover {
  color: var(--brand);
  background-color: rgba(255, 133, 0, 0.16);
}

/* ---- the rail burger and the activity spinner (PX, like the rail) -------- */

/* The page header's rail toggle (pages/Rail.jsx RailToggleButton), on every
   page. Unlike the rail's own #rail-collapse, this one is STATIC — it holds
   its place whether the rail is
   open or closed, which is why it toggles (railToggle.js) instead of only
   opening. A bare icon, no chrome: it sits among the header's other text
   controls, where a box or a border would read as a stray sticker. The 40px box
   is the touch target, not a visible one.
   Two things it has to restate rather than inherit:
     • PIXELS, like styles/rail.css — this is a rail control and has to match
       the rail's own, which do not follow the header's ladder.
     • Its own colours: rail.css's --rail-* tokens live on .rail and never reach
       into the header. Same literals as those controls. */
.header-rail-btn {
  display: grid;
  place-items: center;
  /* Pinned to the header's top-right rather than carried in the flex row: the
     row it used to sit in is the one that wraps UNDER the logo on a phone, and
     this control belongs beside the logo at every width. */
  position: absolute;
  /* A <button> takes its own font-size from the UA sheet, and the offsets below
     are em — take the header's instead, or they would be measured against
     ~13px of Arial. */
  font-size: inherit;
  /* Centred on the logo band's middle: the band starts at the header's padding
     and is 3.5em tall, so its centre is padding + half of that. Positioning the
     box's own centre there (rather than sizing it to the band) keeps the touch
     target free to be bigger than the band on a phone. */
  top: calc(var(--header-pad-top, 0.5em) + 1.75em);
  transform: translateY(-50%);
  /* Mirrors .header-logo-wrap's 1em left padding, so the icon stands as far off
     the right edge as the wordmark does off the left — and, as it happens, as
     far off the header's top edge as well: the 0.5em padding above the logo's
     band plus the (3.5em − icon) / 2 slack inside it comes to the same 1em.
     Three matching gaps out of one value. */
  right: 1em;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #b4b4b4;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}
.header-rail-btn:hover,
.header-rail-btn:focus-visible {
  color: #ececec;
}
/* global.css sets `svg { width: 72rem }` for the page's decorative artwork,
   which would blow this icon up to fill the screen. Keep in step with the
   `size` RailToggleButton passes to icon() (pages/Rail.jsx). */
.header-rail-btn svg {
  width: 40px;
  height: 40px;
}
/* The activity spinner beside the burger (shown by functions/headerLoader.js
   while something is loading). It borrows the toggle's whole geometry — same
   40px box, same centre line, same px units for the same reason — and is placed
   one box further in, so the two read as one pair of controls rather than a
   spinner that landed near a button.
   It is inert: no pointer events, nothing to click, and the ring is drawn on
   ::before so the element itself stays an empty span. */
.header-loader {
  position: absolute;
  top: calc(var(--header-pad-top, 0.5em) + 1.75em);
  transform: translateY(-50%);
  /* The toggle's own right offset plus its width: flush against it, with the
     visual gap coming from the slack each glyph leaves inside its box. It only
     steps aside when the page-description icon is actually there to take this
     slot — see the container query below, which is the whole reason this
     element is rendered inside .header-info. */
  right: calc(1em + 40px);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  pointer-events: none;
}
/* No burger to sit beside (render/renderHostedJobs.js siteHeader — the
   job-editor shell): take its place at the right edge instead of leaving a gap
   where it would have been. */
.header-loader--flush {
  right: 1em;
}
/* The element itself is always in the document — it is a live region
   (role="status"), and one that is added and removed is one an assistive tech
   may never announce. It is invisible until `is-busy`: an empty box with no
   pointer events. */
.header-loader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.header-loader.is-busy::before {
  content: "";
  /* Half the 40px box. The BOX is what matches the burger — it is the thing
     that keeps the two on one centre line — while the ring itself stays well
     inside it: a spinner reads as status, not as a second control, so it should
     not carry the burger's visual weight. */
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 133, 0, 0.22);
  border-top-color: var(--brand);
  animation: header-loader-spin 0.7s linear infinite;
}
/* This sheet's own, so the header does not depend on a keyframe defined in
   global.css (which has one of these for the profile card's spinner). */
@keyframes header-loader-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  /* The ring stays as a static "busy" mark rather than spinning. */
  .header-loader.is-busy::before { animation: none; }
}

/* ===========================================================================
   PHONE (≤510px)
   The header's own font-size is ~9–12px down here, matching the listing pages'
   root. The cards and filters below it are deliberately easier to read than
   that, so the header comes up a step to sit with them, and the EDGE GUTTERS
   are stated in px — they are gutters, not type, and have no business scaling
   with the ladder.
   Unlike before, this applies to EVERY page's header: it used to carve out the
   statistics page, which had a root font of its own and would have been
   re-inflated twice. The header no longer reads that root, so there is nothing
   to carve out.
   =========================================================================== */
@media (max-width: 510px) {
  /* .header-right no longer wraps beneath the logo — it sits BESIDE it at this
     width like every other, so what it needs is a gap from the wordmark rather
     than an inset from the row above. */
  .site-header .header-right {
    box-sizing: border-box;
    padding: 0 0.25em 0 0.5em;
  }

  .site-header .header-top-row {
    column-gap: 0.25em;
    /* The left block can be several lines tall while anything on the right is
       one — line those controls up with the title rather than the text's middle. */
    align-items: flex-start;
  }

  /* One value, --header-gut, so the logo, the address block and the description
     keep a common left edge. --header-pad-top carries the rail toggle down with
     the content (it hangs off the padding box, so it does not inherit the
     padding itself). */
  .site-header {
    --header-gut: 14px;
    --header-pad-top: 12px;
    padding-bottom: 10px;
    /* The toggle's gutter, restored: the header is one row at this width now
       (it used to wrap, leaving the burger the wordmark's row to itself and the
       text below it the full width), so the row has to keep clear of it. Its
       44px box plus the 6px it is inset by, in px like the button itself. */
    padding-right: 50px;
  }

  /* The icon steps down with the header — a 40px burger next to a 28px-tall
     wordmark reads as a different, larger UI. The box stays wide so the tap
     target does not shrink with it, but its HEIGHT is the logo's band exactly:
     a taller box would hang into the row below, where it swallowed taps meant
     for whatever sits at that row's top-right. */
  .site-header .header-rail-btn {
    width: 44px;
    height: 3.5em;
    right: 6px;
  }

  .site-header .header-rail-btn svg {
    width: 28px;
    height: 28px;
  }

  /* The spinner steps down with it and keeps sitting one box further in, so the
     pair stays a pair at this width. The ring keeps its half-of-the-glyph
     proportion against the burger's smaller 28px icon. */
  /* ⚠️ ON A PHONE THE DESCRIPTION IS ALWAYS THE POPOVER, in every language.
     Above this, `.header-info` is `flex: 1 1 13em` and GROWS into whatever the
     row has left — so whether it collapses to the icon depended on how wide the
     scope block beside it happened to be, which is a coincidence of the copy in
     that language rather than a fact about the space.

     English got away with it: "Tokyo / CHAT" left 144.87px, under the 13em the
     container query wants, so it collapsed. Japanese "東京 / チャット" is
     narrower, so it left MORE — 158.69px, over by 5.7px — and the query never
     fired. The reader got the whole page description set solid in a 158px
     column: SIX lines of it, pushing the header to 156px tall, where English
     showed a tidy ⓘ. The language that needs the popover most was the one that
     did not get it.

     Capping the container at the same figure the query tests makes it fire on
     every phone, whatever the row leaves over — and it protects English, whose
     14px of margin any copy change could have eaten just as easily.

     ⚠️ THE TWO 13em FIGURES ARE ONE FIGURE. This cap and the
     `@container header-info (max-width: 13em)` above are the same measurement of
     the same box, so the cap guarantees the query. Change one and change the
     other; tests/header-info-collapse.test.mjs holds them together. */
  .site-header .header-info {
    max-width: 13em;
  }

  /* The page-description icon takes the burger's geometry at this width too,
     one box in from it — and the spinner steps along to the next slot. */
  .site-header .header-info-btn {
    width: 44px;
    height: 3.5em;
    right: 50px;
  }

  .site-header .header-info-btn svg {
    width: 22px;
    height: 22px;
  }

  .site-header .header-loader {
    width: 44px;
    height: 3.5em;
    right: 94px;
  }

  .site-header .header-loader.is-busy::before {
    width: 14px;
    height: 14px;
    border-width: 2px;
  }

  .site-header .header-logo-wrap,
  .site-header .header-nav {
    padding-left: var(--header-gut);
  }

  .site-header .header-left {
    margin-left: 0;
  }

  .site-header .header-nav {
    /* The cap used to be a third of the viewport, because the description sat
       beside this and needed the rest. It is an ICON at this width now, so the
       page's own name gets the room instead — "Engineering & infrastructure
       jobs" was wrapping to three lines and making the header taller than the
       content it sits over.
       And here ALONE it may shrink (the base rule pins it): once the
       description has already collapsed to a glyph there is nothing else left
       to give, so the last resort has to be this, or the row overflows. */
    width: auto;
    max-width: 46vw;
    min-width: 0;
    flex: 0 1 auto;
    box-sizing: border-box;
    flex-wrap: nowrap;
    gap: 0.2em 0.6em;
    padding-left: 1.5em;
    padding-right: 0.25em;
  }

  .site-header .location-picker {
    flex: 0 0 auto;
  }

  .site-header .section-picker {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .site-header .site-nav-link {
    font-size: 1.275em; /* 50% above the regular 0.85em nav label */
    white-space: nowrap;
  }

  .site-header .location-toggle {
    font-size: 1.9em;
  }

  .site-header .section-toggle,
  .site-header .header-section-heading {
    display: block;
    white-space: normal;
    overflow-wrap: normal;
  }

  .site-header .location-menu {
    min-width: 9em;
    max-width: calc(100vw - 3em);
    max-height: 65vh;
    padding: 0.35em;
    /* The panel's rule and shadow are the base rule's — only the border WIDTH
       is restated, because 0.0625em of a ~10px em rounds away to nothing on a
       phone. The 50%-white edge and the near-opaque shadow that used to be
       here were the phone's own, harsher take on a menu the base rule had
       already toned down. */
    border-width: 1px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .site-header .section-menu {
    width: min(18em, calc(100vw - 3em));
  }

  /* Padding in the item's own em again — see the base rule. A phone row is a
     44px-ish tap target, which is what the extra vertical padding buys. */
  .site-header .location-menu-item {
    padding: 0.6em 0.75em;
    font-size: max(1.1em, 10px);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-header .header-buttons-wrap {
    padding-left: 0.25em;
    padding-right: 1.5em;
  }

  .site-header .header-buttons {
    flex-wrap: nowrap;
  }

  .site-header .rank-toggle {
    padding-left: 0.55em;
    padding-right: 0.55em;
    padding-bottom: 0.4em;
  }

  .site-header .header-button {
    font-size: 1.9em;
    white-space: nowrap;
  }

  .site-header .header-nav-btn {
    font-size: 1.05em;
  }

  /* NO min-width restated here. It used to hold the same 13em the base rule
     did, back when that figure decided whether flexbox could keep this beside
     the address or had to move it below. Nothing wraps now, so a floor that
     large is simply an overflow: the row would run 30px past the burger and put
     a horizontal scrollbar on every phone page. The base rule's 2.5em (the
     icon) is the real floor.
     The padding comes in too — at this width this box is usually one glyph. */
  /* Nothing is left IN this box at this width — the icon is pinned to the
     corner and the description is in its panel — so it keeps no padding. The
     space goes to the address pair beside it. */
  .site-header .header-info {
    padding-left: 0;
    padding-right: 0;
  }

  .site-header .header-info-container {
    right: var(--header-gut);
    /* A MEASURE, then the screen — this rule used to be the screen alone, and
       being the more specific of the two it also cancelled the base rule's cap,
       so the panel ran the full width of the phone as two very long lines.
       28em of a ~9px em is ~45 characters, which is what the base rule's 20em
       buys at a 16px one. */
    max-width: min(28em, calc(100% - var(--header-gut) * 2));
    /* The caret's offset, restated because BOTH numbers it is derived from
       change at this width (see the base rule for the arithmetic):
         icon centre from the header's right edge = 50px + 22px
         panel's own right offset                 = --header-gut, 14px
       ⇒ 58px. */
    --info-caret-right: 58px;
  }

  .site-header .header-info-desc {
    font-size: 1.15em;
    /* NOT 1.15. This is a paragraph in a panel now, and at a ~11px face set
       solid it was a block of text with no gaps between the lines — the single
       biggest reason the popover was hard to read. */
    line-height: 1.45;
  }
}
html[lang="ja"] .site-header .header-info-desc {
  line-height: 1.45;
}
html[lang="ja"] .site-header .header-button {
  line-height: 1;
}
/* The JP face fills more of its em box than Darker Grotesque. Use equal
   vertical padding so labels such as 総合ランキング do not sit against the top
   edge of the rank control. */
html[lang="ja"] .site-header .rank-toggle {
  padding-top: 0.25em;
  padding-bottom: 0.25em;
}

@media (max-width: 1300px) {}

@media (max-width: 510px) {
  html[lang="ja"] .site-header .rank-toggle {
    padding-top: 0.2em;
    padding-bottom: 0.2em;
  }
  /* MORE leading than the Latin face, not less. The JP face fills more of its
     em box, so 1.3 in the popover put stacked Japanese lines almost touching —
     it was the right figure back when this was one line beside the pickers. */
  html[lang="ja"] .site-header .header-info-desc {
    line-height: 1.65;
  }
}
