:root {
  --rpl-primary: #1c375b;
  --rpl-secondary: #6f8197;
  --rpl-white: #ffffff;
  --rpl-light: #f5f7fa;
  --rpl-border: rgba(111, 129, 151, 0.32);
  --rpl-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--rpl-primary);
  background: var(--rpl-white);
  font-family: var(--rpl-font);
}

body.menu-open {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 9999;
  padding: 9px 12px;
  color: var(--rpl-white);
  background: var(--rpl-primary);
  font-size: 14px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--rpl-white);
  border-bottom: 1px solid var(--rpl-border);
}

.header-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* Top institutional bar */
.header-topbar {
  display: none;
  color: var(--rpl-white);
  background: var(--rpl-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.topbar-inner {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
}

.topbar-links a {
  color: var(--rpl-white);
  text-decoration: none;
}

.topbar-links a:hover,
.topbar-links a:focus-visible {
  text-decoration: underline;
  outline: none;
}

/* Main header */
.header-main {
  background: var(--rpl-white);
}

.header-main-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 176px;
  max-width: 58vw;
  height: auto;
}

/* Desktop navigation */
.desktop-nav {
  display: none;
  align-items: center;
  margin-left: auto;
}

.desktop-nav a {
  min-height: 72px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: var(--rpl-primary);
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  color: var(--rpl-secondary);
  border-bottom-color: var(--rpl-secondary);
  outline: none;
}

.header-cta {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rpl-white);
  background: var(--rpl-primary);
  border: 1px solid var(--rpl-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.header-cta:hover,
.header-cta:focus-visible {
  background: var(--rpl-secondary);
  border-color: var(--rpl-secondary);
  outline: none;
}

.desktop-cta {
  display: none;
}

/* Mobile button */
.menu-toggle {
  width: 42px;
  height: 42px;
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--rpl-primary);
  background: var(--rpl-white);
  border: 1px solid var(--rpl-border);
  cursor: pointer;
}

.menu-toggle-line {
  width: 20px;
  height: 2px;
  display: block;
  background: var(--rpl-primary);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 73px 0 auto 0;
  max-height: calc(100dvh - 73px);
  overflow-y: auto;
  background: var(--rpl-white);
  border-top: 1px solid var(--rpl-border);
  border-bottom: 1px solid var(--rpl-border);
  box-shadow: 0 14px 34px rgba(28, 55, 91, 0.14);
}

.mobile-menu-inner {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 10px 16px 18px;
  display: grid;
}

.mobile-menu a:not(.mobile-cta) {
  min-height: 50px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  color: var(--rpl-primary);
  border-bottom: 1px solid var(--rpl-border);
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
}

.mobile-menu a:not(.mobile-cta):hover,
.mobile-menu a:not(.mobile-cta):focus-visible {
  color: var(--rpl-secondary);
  outline: none;
}

.mobile-cta {
  min-height: 46px;
  margin-top: 16px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rpl-white);
  background: var(--rpl-primary);
  border: 1px solid var(--rpl-primary);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}

.mobile-cta:hover,
.mobile-cta:focus-visible {
  background: var(--rpl-secondary);
  border-color: var(--rpl-secondary);
  outline: none;
}

.mobile-compliance-note {
  margin: 14px 0 0;
  padding: 12px;
  color: var(--rpl-primary);
  background: var(--rpl-light);
  border-left: 3px solid var(--rpl-secondary);
  font-size: 13px;
  line-height: 1.55;
}

/* Tablet and desktop */
@media (min-width: 760px) {
  .header-container {
    width: min(1180px, calc(100% - 48px));
  }

  .brand-logo {
    width: 190px;
  }
}

@media (min-width: 980px) {
  .header-topbar {
    display: block;
  }

  .header-main-inner {
    min-height: 78px;
  }

  .brand-logo {
    width: 210px;
  }

  .desktop-nav {
    display: inline-flex;
  }

  .desktop-cta {
    display: inline-flex;
  }

  .menu-toggle,
  .mobile-menu {
    display: none !important;
  }
}

@media (min-width: 1120px) {
  .desktop-nav a {
    padding-inline: 15px;
  }

  .header-cta {
    padding-inline: 18px;
  }
}