:root {
  /* Dynamic header offset so floating headers don't cover hero content */
  --portal-header-height: clamp(76px, 10vw, 96px);
  --portal-header-offset: calc(var(--portal-header-height) + 24px);
  --header-bg: rgba(255, 255, 255, 0.08);
  --header-border: rgba(255, 255, 255, 0.15);
  --nav-bg-mobile: rgba(15, 23, 42, 0.75);
  --nav-border-mobile: rgba(255, 255, 255, 0.12);
}

/* Fallback class to prevent background scrolling when mobile menu is open */
.no-scroll {
  overflow: hidden;
  height: 100%;
}

.portal-header {
  width: min(1200px, calc(100% - 36px));
  max-width: 1200px;
  left: 50%;
  transform: translateX(-50%);
  top: max(16px, env(safe-area-inset-top));
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--header-border);
  border-radius: 20px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: none;
  position: absolute;
  z-index: 10001;
}

.brand-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-wrapper:hover,
.brand-logo-wrapper:focus-visible {
  text-decoration: none;
  color: inherit;
}

.brand-icon-box {
  background-color: #2563eb;
  color: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.brand-logo-wrapper.has-brand-image {
  gap: 0;
  height: 42px;
}

.brand-logo-wrapper.has-brand-image .brand-icon-box,
.brand-logo-wrapper.has-brand-image .brand-name {
  display: none;
}

.site-brand-logo-image {
  display: block;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.brand-name {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.portal-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
  position: relative;
}

.portal-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition:
    transform 0.25s ease,
    width 0.25s ease;
}

.portal-nav a:hover,
.portal-nav a.active {
  color: #ffffff;
}

.portal-nav a:hover::after,
.portal-nav a.active::after {
  width: 100%;
  transform: translateX(-50%) scaleX(1);
}

.portal-nav a.active {
  font-weight: 700;
}

.portal-nav .mobile-only-cta {
  display: none;
}

.header-actions-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-pill-btn {
  background-color: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 10px;
  transition:
    background-color 0.2s,
    transform 0.1s;
  white-space: nowrap;
}

.contact-pill-btn:hover {
  background-color: #1d4ed8;
}

.portal-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 15, 30, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.35s;
}

.portal-menu-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  transition: none;
  width: auto;
  height: auto;
  margin: 0;
}

.mobile-menu-toggle:hover {
  background-color: transparent;
}

.hamburger-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 18px;
  position: relative;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #ffffff;
  border-radius: 999px;
  transition:
    transform 0.3s ease,
    opacity 0.25s ease,
    background-color 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.open .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.open .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.portal-footer {
  width: 100%;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 0.92)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 36px 0 20px;
  color: rgba(255, 255, 255, 0.85);
}

.footer-inner {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1.6 1 420px;
  min-width: 360px;
  width: 100%;
}

.footer-brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.8;
  font-size: 0.98rem;
}

.footer-nav-grid {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  flex: 1 1 360px;
  min-width: 300px;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 1;
}

.footer-section h3 {
  margin: 0;
  color: #ffffff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.94rem;
  line-height: 1.8;
  transition:
    color 0.2s,
    transform 0.2s;
}

.footer-section a:hover {
  color: #ffffff;
  transform: translateX(2px);
}

.footer-note {
  width: 100%;
  margin: 0;
  padding: 28px 24px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  position: relative;
}

.footer-note::before {
  content: "";
  display: block;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin-bottom: 16px;
}

@media (max-width: 992px) {
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  .footer-brand {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: none;
  }

  .footer-nav-grid {
    width: 100%;
    flex: none;
    min-width: 0;
    justify-content: space-between;
  }

  .footer-section {
    width: calc(50% - 18px);
    min-width: 220px;
  }
}

@media (max-width: 576px) {
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .footer-brand,
  .footer-nav-grid,
  .footer-section {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .footer-nav-grid {
    flex-direction: column;
    gap: 18px;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .portal-header {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 12px 16px;
    border-radius: 20px;
    transform: none;
  }

  .mobile-menu-toggle {
    display: flex;
    position: relative;
    z-index: 10002;
  }

  .portal-nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--nav-bg-mobile);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--nav-border-mobile);
    border-radius: 20px;
    flex-direction: column;
    padding: 28px 24px 24px;
    gap: 8px;
    box-shadow: none;
    opacity: 0;
    transform: translateY(-16px) scale(0.97);
    pointer-events: none;
    transition:
      opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10001;
    min-width: unset;
  }

  .portal-nav.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .portal-nav a {
    font-size: 0.95rem;
    padding: 12px 16px;
    width: 100%;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
    display: block;
    text-align: left;
    font-weight: 500;
    position: relative;
    padding-left: 24px;
  }

  .portal-nav a:hover,
  .portal-nav a:active {
    color: #ffffff;
  }

  .portal-nav a::after,
  .portal-nav a:hover::after,
  .portal-nav a:active::after,
  .portal-nav a.active::after {
    display: none;
  }

  .portal-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
  }

  .portal-nav a.active {
    color: #3b82f6;
    font-weight: 700;
  }

  .header-actions-right .contact-pill-btn {
    display: none;
  }

  .portal-nav .mobile-only-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 700;
    padding: 14px;
    border-radius: 10px;
    margin-top: 14px;
    box-shadow: none;
    text-align: center;
  }

  .portal-nav .mobile-only-cta:hover,
  .portal-nav .mobile-only-cta:active {
    background-color: #1d4ed8;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .footer-inner > span {
    order: 1;
    width: 100%;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
  }
}
