/* IME — site header.
   Sticky header, logo lockup, desktop nav, mobile drawer and the nav CTA.
   Markup for this lives at the top of every page; behaviour is in site.js. */

/* The shared chrome carries its own copy of the tokens it paints with.
   Pages such as tools/* and about.php declare a page-local :root palette that
   reuses these same names; without this the header and footer would take that
   page's colours and look different on every page. Values mirror tokens.css. */
header#siteHeader,
footer#pricing {
  --blue: #155ecb;
  --navy-deep: #051c42;
  --ink: #0e1b33;
  --muted: #5c6c8a;
  --line: #d3e0f4;
  --ice: #e7f0ff;
  --ease: cubic-bezier(.22, .9, .28, 1);
}

/* ---------- Nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(233, 242, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}

header.scrolled {
  border-color: var(--line);
  box-shadow: 0 10px 30px rgba(10, 47, 107, .06);
}

#tools,
#about,
#trust,
#pricing-section,
#demo,
#testimonials,
#contact {
  scroll-margin-top: 100px;
}

.header-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 4%;
  transition: padding .35s var(--ease);
}

header.scrolled .header-inner {
  padding: 14px 4%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -.02em;
  color: var(--navy-deep);
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
  flex: none;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
  padding-left: 12px;
  border-left: 1.5px solid var(--line);
}

.logo-tagline {
  font-size: .8rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.logo-fallback {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--navy-deep);
}

.logo-fallback b {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.logo-fallback-dark {
  color: #fff;
}

footer .logo-text {
  border-left-color: rgba(255, 255, 255, .22);
}

footer .logo-tagline {
  color: #6fa4f2;
}

@media (max-width: 640px) {
  :root {
    --header-h: 77px;
  }

  .logo-img {
    height: 32px;
  }

  .logo-text {
    padding-left: 9px;
  }

  .logo-tagline {
    font-size: .68rem;
  }
}

@media (max-width: 380px) {
  .logo-text {
    display: none;
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy-deep);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
  margin: 0 auto;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  nav#siteNav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 82vw);
    height: 100vh;
    background: #fff;
    box-shadow: -12px 0 40px rgba(10, 47, 107, .18);
    padding: 90px 28px 28px;
    transition: right .35s var(--ease);
    overflow-y: auto;
    z-index: 99;
  }

  nav#siteNav.open {
    right: 0;
  }

  nav#siteNav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  nav#siteNav ul li {
    width: 100%;
  }

  nav#siteNav ul li a {
    display: block;
    padding: 12px 0;
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  nav#siteNav ul li a.cta {
    margin-top: 14px;
    border-bottom: none;
    text-align: center;
    padding: 13px 0;
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    background: rgba(5, 28, 66, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease);
    z-index: 98;
  }

  .nav-scrim.open {
    opacity: 1;
    pointer-events: auto;
  }
}

nav ul {
  display: flex;
  gap: 38px;
  align-items: center;
  list-style: none;
}

nav a {
  font-weight: 500;
  font-size: .92rem;
  color: var(--muted);
  position: relative;
  padding: 6px 0;
  transition: color .25s ease;
}

nav a:not(.cta):hover {
  color: var(--navy-deep);
}

nav a:not(.cta)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--blue);
  transition: width .3s var(--ease);
}

nav a:not(.cta):hover::after {
  width: 100%;
}

.cta {
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy-deep) 100%);
  color: #fff !important;
  padding: 11px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  transition: transform .3s var(--ease), filter .3s ease, box-shadow .3s ease;
  box-shadow: 0 6px 16px -4px rgba(21, 94, 203, .35);
}

.cta:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -6px rgba(21, 94, 203, .45);
}
/* ---------- Signed-in profile menu ---------- */
/* Replaces the Sign Up + CTA pair once someone is signed in to the portal. */
.nav-profile {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  cursor: pointer;
  font: inherit;
  color: var(--navy-deep);
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.profile-trigger:hover,
.profile-trigger.open {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 6px 16px -6px rgba(21, 94, 203, .35);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy-deep) 100%);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1;
}

.profile-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
  max-width: 160px;
}

.profile-name {
  font-weight: 600;
  font-size: .88rem;
  color: var(--navy-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.profile-role {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.profile-caret {
  width: 11px;
  height: 8px;
  flex: none;
  color: var(--muted);
  transition: transform .25s var(--ease);
}

.profile-trigger.open .profile-caret {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(10, 47, 107, .28);
  z-index: 120;
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu li {
  width: 100%;
}

.profile-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .89rem;
  font-weight: 500;
  color: var(--ink);
  transition: background .2s ease, color .2s ease;
}

/* The nav's sliding underline would fight the menu rows. */
.profile-menu a::after {
  content: none;
}

.profile-menu a:hover {
  background: var(--ice);
  color: var(--navy-deep);
}

.profile-menu .profile-signout {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  color: #c0392b;
}

.profile-menu .profile-signout:hover {
  background: #fdecea;
  color: #a5281b;
}

@media (max-width: 900px) {

  /* Inside the drawer the menu drops inline instead of floating. */
  .profile-trigger {
    width: 100%;
    margin-top: 14px;
    justify-content: flex-start;
    border-radius: 12px;
    padding: 10px 12px;
  }

  .profile-caret {
    margin-left: auto;
  }

  .profile-menu {
    position: static;
    min-width: 0;
    margin-top: 8px;
    box-shadow: none;
  }

  nav#siteNav ul li.nav-profile a {
    border-bottom: none;
    padding: 11px 14px;
  }
}
