/* Site header: blue at the top of the page, white once you scroll.
   js/header.js adds .is-scrolled. Without JS the header simply stays blue. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0B3DF2;
  color: #FFFFFF;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background: #FFFFFF;
  color: #0A0A2A;
  box-shadow: 0 1px 0 #C4C4DC;
}

.site-nav {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo: white and blue versions stacked; the scrolled state crossfades between them. */
.site-logo {
  display: grid;
  padding: 8px 0;
  text-decoration: none;
}
.site-logo img {
  grid-area: 1 / 1;
  height: 38px;
  width: auto;
  display: block;
  transition: opacity 0.3s ease;
}
.site-logo .logo-blue { opacity: 0; }
.is-scrolled .site-logo .logo-white { opacity: 0; }
.is-scrolled .site-logo .logo-blue { opacity: 1; }

.site-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  font-size: 15px;
  font-weight: 600;
}

.site-header .nav-link {
  color: inherit;
  text-decoration: none;
  padding: 12px 0;
}

/* Current page and hover: lime on blue, brand blue on white. */
.site-header .nav-link:hover,
.site-header .nav-link[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  text-decoration-color: #D4F76A;
  color: inherit;
}
.site-header.is-scrolled .nav-link:hover,
.site-header.is-scrolled .nav-link[aria-current="page"] {
  text-decoration-color: #0B3DF2;
}

.site-header .nav-cta {
  text-decoration: none;
  padding: 12px 22px;
  background: #D4F76A;
  color: #0A0A2A;
  border-radius: 999px;
  transition: background-color 0.3s ease;
}
.site-header .nav-cta:hover {
  background: #E6FBA6;
  color: #0A0A2A;
}

/* Freelancer login: an outline pill, white on the blue header, ink once it turns white. */
.site-header .nav-outline {
  text-decoration: none;
  padding: 10px 20px;
  color: inherit;
  border: 2px solid currentColor;
  border-radius: 999px;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.site-header .nav-outline:hover {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: #0B3DF2;
}
.site-header.is-scrolled .nav-outline:hover {
  background: #0A0A2A;
  border-color: #0A0A2A;
  color: #FFFFFF;
}
.site-header .nav-outline[aria-current="page"] {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: #0B3DF2;
}
.site-header.is-scrolled .nav-outline[aria-current="page"] {
  background: #0A0A2A;
  border-color: #0A0A2A;
  color: #FFFFFF;
}

.site-header :focus-visible {
  outline: 3px solid #D4F76A;
  outline-offset: 3px;
}
.site-header.is-scrolled :focus-visible {
  outline-color: #0B3DF2;
}

/* ---- Mobile menu (below 1180px, where the eight links stop fitting on one line) ----------
   Only collapses when <html> has the .js class (added in <head>), so without JavaScript the
   links simply wrap and stay usable. */

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.nav-toggle-icon {
  position: relative;
  width: 18px;
  height: 12px;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after,
.nav-toggle-icon span {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}
.nav-toggle-icon::before { top: 0; }
.nav-toggle-icon span { top: 5px; }
.nav-toggle-icon::after { top: 10px; }
.nav-open .nav-toggle-icon::before { transform: translateY(5px) rotate(45deg); }
.nav-open .nav-toggle-icon span { opacity: 0; }
.nav-open .nav-toggle-icon::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 1179px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { flex-wrap: nowrap; }

  .js .site-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 100%);
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 24px 28px;
    background: #0B3DF2;
    font-size: 20px;
    box-shadow: 0 24px 40px -24px rgba(10, 10, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.25s;
  }
  .js .site-header.is-scrolled .site-links { background: #FFFFFF; }
  .js .site-header.nav-open .site-links {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
  }

  .js .site-links .nav-link {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  }
  .js .site-header.is-scrolled .site-links .nav-link { border-bottom-color: rgba(10, 10, 42, 0.12); }

  .js .site-links .nav-outline,
  .js .site-links .nav-cta {
    margin-top: 16px;
    padding: 16px 22px;
    text-align: center;
  }
  .js .site-links .nav-outline { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-links, .nav-toggle-icon::before, .nav-toggle-icon::after, .nav-toggle-icon span { transition: none !important; }
}
