/* One header for the landing page and the guides: logo, the page's sections
   (landing page only), language, one call to action, and a reading-progress
   bar along its top edge. Behaviour: /header.js. Like /footer.css, every rule
   is scoped under .careers-header so it outranks each page's bare element
   rules whatever order the sheets load in.

   Two placements:
   - default (guides): sticky in the flow, solid navy over the navy hero;
   - .is-overlay (landing page): fixed, frosted navy; transparent while the
     page is at the top (.is-top). The page reserves --ch-h of room for it. */
:root { --ch-h: 64px; }
@media (max-width: 768px) { :root { --ch-h: 56px; } }

.careers-header {
  --ch-navy: #011131;
  --ch-lavender: #aac2fe;
  --ch-green: #86ea63;
  --ch-green-hover: #00cf60;
  --ch-rule: rgba(170, 194, 254, 0.16);
  --ch-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: sticky;
  top: 0;
  z-index: 70;
  width: 100%;
  min-width: 0;
  background: var(--ch-navy);
  color: #eef3fb;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 320ms var(--ch-ease), box-shadow 320ms var(--ch-ease);
}
.careers-header *, .careers-header *::before, .careers-header *::after { box-sizing: border-box; }
/* Frosted by default, so the bar stays readable over white sections even
   without header.js; the script clears it (.is-top) while the hero is under it. */
.careers-header.is-overlay {
  position: fixed;
  left: 0;
  right: 0;
  background: rgba(1, 17, 49, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .careers-header.is-overlay { background: var(--ch-navy); }
}
.careers-header.is-overlay.is-top { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* An inset hairline, not a border: the bar stays exactly --ch-h tall. */
.careers-header.is-scrolled { box-shadow: inset 0 -1px 0 var(--ch-rule); }

.careers-header .ch-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1200px, 100% - 48px);
  height: var(--ch-h);
  margin-inline: auto;
}

/* ── Skip link: off screen until focused ── */
.careers-header .ch-skip {
  position: absolute;
  top: 8px;
  left: 16px;
  z-index: 2;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f6f8fc;
  color: var(--ch-navy);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}
.careers-header .ch-skip:focus { transform: none; }

/* ── Reading progress: a hairline along the top edge. Scaled, not resized,
   so following the scroll never triggers layout. ── */
.careers-header .ch-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  pointer-events: none;
  overflow: hidden;
}
.careers-header .ch-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00e66b 0%, #0cd6dc 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ── Brand ── */
.careers-header .ch-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  min-height: 44px;
  color: #eef3fb;
  text-decoration: none;
  border-radius: 6px;
}
.careers-header .ch-brand img { display: block; width: auto; height: 24px; }
.careers-header .ch-brand-sub {
  padding-left: 14px;
  border-left: 1px solid rgba(170, 194, 254, 0.35);
  color: #c5d2ec;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.6;
  white-space: nowrap;
}

/* ── Section links (landing page) ── */
.careers-header .ch-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline: auto;
}
.careers-header .ch-links a {
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  color: #c0cee8;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
  transition: color 0.15s;
}
.careers-header .ch-links a:hover { color: #eef3fb; text-decoration: none; }
.careers-header .ch-links a[aria-current] { color: var(--ch-green); }
/* Without the motion kit the current link draws its own underline; with it,
   one indicator travels between links (header.js adds .has-rail). */
.careers-header .ch-links a[aria-current]::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--ch-green);
}
.careers-header .ch-links.has-rail a[aria-current]::after { display: none; }
.careers-header .ch-links .m-liquid::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--ch-green);
}

/* ── Actions: language + call to action ── */
.careers-header .ch-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.careers-header .ch-links + .ch-actions { margin-left: 0; }

/* Landing page: the native language <select>, behind a globe. */
.careers-header .ch-lang { position: relative; display: inline-flex; align-items: center; }
.careers-header .ch-lang-globe,
.careers-header .ch-lang-chevron {
  position: absolute;
  pointer-events: none;
  color: #c5d2ec;
}
.careers-header .ch-lang-globe { left: 11px; width: 16px; height: 16px; }
.careers-header .ch-lang-chevron { right: 11px; width: 10px; height: 10px; }
.careers-header .lang-picker {
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  padding: 0 30px 0 34px;
  border: 1px solid rgba(170, 194, 254, 0.35);
  border-radius: 8px;
  background: rgba(170, 194, 254, 0.08);
  color: #eef3fb;
  font: 500 14px/1 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.careers-header .lang-picker:hover { background: rgba(170, 194, 254, 0.14); }
.careers-header .lang-picker:focus-visible { border-color: var(--ch-lavender); box-shadow: 0 0 0 3px rgba(170, 194, 254, 0.45); }
.careers-header .lang-picker option { color: var(--ch-navy); background: #f6f8fc; }

/* Guides: language links (each page has its own URL per language). */
.careers-header .ch-langs { display: flex; align-items: center; gap: 2px; }
.careers-header .ch-langs a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: #b8c7e3;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.careers-header .ch-langs a:hover { color: #eef3fb; background: rgba(170, 194, 254, 0.10); text-decoration: none; }
.careers-header .ch-langs a[aria-current] { color: #eef3fb; font-weight: 600; background: rgba(170, 194, 254, 0.12); }
.careers-header .ch-lang-short { display: none; }

/* Call to action. On the landing page two share one cell — "See open roles"
   until the role list, then "Find your fit" — both as wide as the wider one,
   so swapping them never moves anything else in the bar. */
.careers-header .ch-cta-slot { display: grid; }
.careers-header .ch-cta-slot > .ch-cta { grid-area: 1 / 1; justify-content: center; }
.careers-header .ch-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--ch-green);
  color: var(--ch-navy);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, opacity 0.2s var(--ch-ease), visibility 0s linear 0s;
}
.careers-header .ch-cta:hover { background: var(--ch-green-hover); color: var(--ch-navy); text-decoration: none; }
.careers-header .ch-cta svg { width: 14px; height: 14px; flex-shrink: 0; }
.careers-header .ch-cta-short { display: none; }
.careers-header .ch-cta.is-off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: background-color 0.15s, opacity 0.2s var(--ch-ease), visibility 0s linear 0.2s;
}

.careers-header :focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(170, 194, 254, 0.45); }

/* ── Narrower screens ── */
@media (max-width: 1180px) {
  .careers-header .ch-brand-sub { display: none; }
}
/* The section links need the full row; below that the bar keeps logo,
   language and call to action. */
@media (max-width: 1060px) {
  .careers-header .ch-links { display: none; }
  .careers-header .ch-links + .ch-actions { margin-left: auto; }
  .careers-header .ch-brand-sub { display: inline; }
}
@media (max-width: 768px) {
  .careers-header .ch-inner { width: calc(100% - 32px); gap: 12px; }
  .careers-header .ch-actions { gap: 8px; }
  .careers-header .ch-brand-sub { display: none; }
  .careers-header .ch-brand img { height: 20px; }
  /* iOS zooms into any focused field under 16px and stays zoomed. */
  .careers-header .lang-picker { font-size: 16px; }
}
/* Phones: the language picker becomes a globe button (the native list still
   names every language), the guides show language codes, and the call to
   action takes its short label. Nothing wraps or scrolls sideways. */
@media (max-width: 520px) {
  .careers-header .ch-lang { width: 40px; }
  .careers-header .ch-lang-globe { left: 11px; width: 18px; height: 18px; }
  .careers-header .ch-lang-chevron { display: none; }
  .careers-header .lang-picker { width: 40px; padding: 0; color: transparent; }
  .careers-header .ch-langs a { padding: 0 8px; }
  .careers-header .ch-lang-long {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .careers-header .ch-lang-short { display: inline; }
  .careers-header .ch-cta { padding: 0 12px; }
  .careers-header .ch-cta svg { display: none; }
  .careers-header .ch-cta-long { display: none; }
  .careers-header .ch-cta-short { display: inline; }
  /* "Find your fit" is too long for a phone bar (the role list's own banner
     carries it), so "Open roles" stays: it leads back to the filters. */
  .careers-header .ch-cta-fit { display: none; }
  .careers-header .ch-cta[data-cta="roles"].is-off { opacity: 1; visibility: visible; pointer-events: auto; }
  /* Guides: the hero's button already leads to the roles. */
  .careers-header .ch-cta-guide { display: none; }
}
/* Touch screens: 44px targets (the bar is tall enough to hold them). */
@media (pointer: coarse) {
  .careers-header .ch-langs a, .careers-header .ch-cta { min-height: 44px; }
  .careers-header .lang-picker, .careers-header .ch-lang { height: 44px; }
  .careers-header .ch-lang { min-width: 44px; }
  .careers-header .lang-picker { min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .careers-header, .careers-header .ch-cta { transition: none; }
}
