/* Fixed header, navigation (desktop dropdowns + mobile drawer), footer. */

.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(247, 248, 250, 0.82);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.site-header.is-scrolled { background: rgba(247, 248, 250, 0.96); box-shadow: 0 1px 20px rgba(15, 33, 55, 0.04); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: var(--header-h); padding-inline: var(--gutter);
  max-width: calc(var(--container-wide) + var(--gutter) * 2); margin-inline: auto;
  transition: min-height 0.4s ease;
}
.site-header.is-scrolled .site-header__inner { min-height: calc(var(--header-h) - 12px); }

/* Logo */
.site-logo {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; color: var(--navy);
}
.site-logo:hover { color: var(--navy); }
.site-logo .hex-icon { width: 28px; height: 28px; display: block; }
.site-logo .hex-icon svg { width: 100%; height: 100%; }
.site-logo--image img { max-height: 44px; width: auto; }

/* Desktop nav */
.site-nav { display: flex; align-items: center; gap: 36px; }
.nav-menu { display: flex; align-items: center; gap: 36px; }
.nav-menu--secondary { gap: 20px; padding-left: 28px; border-left: 1px solid var(--border); }
.nav-menu > li { position: relative; }
.nav-menu a {
  display: inline-block; padding: 8px 0; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.02em;
  color: var(--text); text-decoration: none; position: relative; transition: color var(--dur); white-space: nowrap;
}
.nav-menu--secondary a { color: var(--muted); }
.nav-menu > li > a::after {
  content: ''; position: absolute; bottom: 2px; left: 0; width: 0; height: 2px; background: var(--orange); transition: width var(--dur) ease;
}
.nav-menu > li > a:hover, .nav-menu > li.current-menu-item > a, .nav-menu > li.current-menu-ancestor > a { color: var(--navy); }
.nav-menu > li > a:hover::after, .nav-menu > li.current-menu-item > a::after, .nav-menu > li.current-menu-ancestor > a::after { width: 100%; }
.nav-menu .menu-item-has-children > a { padding-right: 16px; }
.nav-menu .menu-item-has-children > a::before {
  content: ''; position: absolute; right: 0; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: 0.6;
}
.sub-menu {
  position: absolute; top: calc(100% + 8px); left: -20px; min-width: 240px; padding: 10px;
  background: #fff; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-soft);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
}
.sub-menu::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.nav-menu > li:hover > .sub-menu, .nav-menu > li:focus-within > .sub-menu, .nav-menu > li.is-open > .sub-menu {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.sub-menu a { display: block; padding: 10px 14px; border-radius: 8px; font-weight: 500; color: var(--text); }
.sub-menu a:hover { background: var(--bg); color: var(--navy); }
.sub-menu .menu-item-description { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.sub-menu__toggle { display: none; }
.sub-menu__parent-link { display: none; }

/* Hamburger */
.nav-toggle {
  display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  border-radius: var(--radius); margin-right: -8px;
}
.nav-toggle__bar { display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform var(--dur), opacity var(--dur); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
@media (max-width: 1200px) {
  .nav-menu, .site-nav { gap: 22px; }
  .nav-menu--secondary { padding-left: 18px; gap: 14px; }
  .btn-nav { padding: 10px 18px; }
}
@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  /* backdrop-filter on the header would make it the containing block for this fixed drawer, so it is removed while open. */
  body.nav-open .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    display: block; padding: 16px var(--gutter) 40px; overflow-y: auto;
    background: var(--bg); border-top: 1px solid var(--border);
    transform: translateX(100%); transition: transform 0.4s var(--ease-out); visibility: hidden;
  }
  .admin-bar .site-nav { top: calc(var(--header-h) + 46px); }
  body.nav-open .site-nav { transform: none; visibility: visible; }
  body.nav-open { overflow: hidden; }
  .nav-menu { display: block; }
  .nav-menu--secondary { border-left: 0; padding-left: 0; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
  .nav-menu--primary > li:last-child { border-bottom: 0; }
  .nav-menu > li { border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; }
  .nav-menu > li > a { flex: 1; padding: 16px 0; font-size: 1.05rem; }
  .nav-menu > li.menu-item-has-children { cursor: pointer; }
  .nav-menu > li.menu-item-has-children > a { padding-right: 8px; }
  .sub-menu__parent-link { display: block; }
  .sub-menu__parent-link a { font-weight: 600; color: var(--navy); }
  .nav-menu > li > a::after { display: none; }
  .nav-menu .menu-item-has-children > a::before { display: none; }
  .sub-menu__toggle {
    display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--radius);
  }
  .sub-menu__toggle::before {
    content: ''; width: 8px; height: 8px; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
    transform: rotate(45deg); transition: transform var(--dur);
  }
  .nav-menu > li.is-open > .sub-menu__toggle::before { transform: rotate(-135deg); }
  .sub-menu {
    position: static; width: 100%; min-width: 0; padding: 0 0 12px 12px; border: 0; box-shadow: none; background: none;
    opacity: 1; visibility: visible; transform: none; display: none;
  }
  .nav-menu > li.is-open > .sub-menu { display: block; }
  .sub-menu a { padding: 10px 12px; font-size: 0.98rem; }
  .btn-nav { display: inline-flex; margin-top: 24px; padding: 14px 28px; font-size: 0.95rem; }
}

/* Footer */
/* Footer text colours: all measured against #132B45. --footer-text 7.5:1, --footer-link 8.6:1, --footer-dim 6.6:1, titles 6.3:1. */
.site-footer {
  --footer-text: rgba(247, 248, 250, 0.72);
  --footer-link: rgba(247, 248, 250, 0.80);
  --footer-dim: rgba(247, 248, 250, 0.65);
  --footer-title: rgba(247, 248, 250, 0.62); /* 6.3:1 on navy-deep; muted grey per Jim, not the teal */
  background: var(--navy-deep); color: var(--text-light); padding: 80px 0 40px; position: relative; overflow: hidden;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--teal), var(--green), var(--orange));
  background-size: 300% 100%; animation: gradientSlide 8s linear infinite;
}
@keyframes gradientSlide { from { background-position: 0% 0%; } to { background-position: 300% 0%; } }
@media (prefers-reduced-motion: reduce) { .site-footer::before { animation: none; } }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px; padding-bottom: 60px; border-bottom: 1px solid var(--border-light); }
.footer-brand .site-logo { color: var(--text-light); margin-bottom: 16px; }
.footer-desc { font-size: 0.9rem; color: var(--footer-text); line-height: 1.7; max-width: 320px; }
.footer-col__title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 20px; color: var(--footer-title); }
.footer-menu a { display: block; font-size: 0.9rem; color: var(--footer-link); text-decoration: none; margin-bottom: 12px; transition: color var(--dur); }
.footer-menu a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-top--contact { grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr; gap: 48px; }

/* Social icons: solid hex fill, no border (a border inside a clip-path renders as a jagged halo). */
.footer-social { display: flex; gap: 10px; margin-top: 24px; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 46px;
  color: var(--footer-link); background: rgba(247, 248, 250, 0.12);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: color var(--dur), background var(--dur), transform var(--dur);
}
.footer-social a:hover { color: #fff; background: var(--orange); transform: translateY(-2px); }
.footer-social a:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 0; clip-path: none; border-radius: 6px; }

/* App badges */
.footer-apps { margin-top: 28px; }
.footer-apps__label { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--footer-dim); margin-bottom: 10px; }
.footer-apps__badges { display: flex; flex-wrap: wrap; gap: 10px; }
.app-badge {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 5px 12px 5px 10px;
  background: #0B1A2B; color: #fff; border: 1px solid rgba(247, 248, 250, 0.22); border-radius: 8px; text-decoration: none;
  transition: border-color var(--dur), transform var(--dur), background var(--dur);
}
.app-badge:hover { color: #fff; border-color: rgba(247, 248, 250, 0.55); background: #0F2137; transform: translateY(-1px); }
.app-badge svg { flex: none; }
.app-badge__text { display: flex; flex-direction: column; line-height: 1.1; }
.app-badge__small { font-size: 0.62rem; letter-spacing: 0.02em; opacity: 0.85; }
.app-badge__big { font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }

/* Contact column */
.footer-contact { font-style: normal; display: grid; gap: 10px; }
.footer-contact__item { display: block; font-size: 0.9rem; line-height: 1.6; color: var(--footer-link); text-decoration: none; transition: color var(--dur); }
a.footer-contact__item:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-contact__address { margin-top: 6px; color: var(--footer-text); }

/* Legal row */
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; padding-top: 32px; font-size: 0.82rem; color: var(--footer-dim); }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.legal-menu { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.legal-menu a, .legal-dns { color: var(--footer-link); text-decoration: none; transition: color var(--dur); }
.legal-menu a:hover, .legal-dns:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.legal-dns { position: relative; padding-left: 24px; }
.legal-dns::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 1px; height: 14px; margin-top: -7px; background: rgba(247, 248, 250, 0.25);
}

@media (max-width: 1200px) {
  .footer-top--contact { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .footer-col--contact { grid-column: 2 / -1; display: grid; grid-template-columns: subgrid; }
  .footer-col--contact .footer-col__title { grid-column: 1 / -1; }
  .footer-col--contact .footer-contact { grid-column: 1 / -1; grid-template-columns: repeat(3, auto); justify-content: start; gap: 10px 40px; }
}
@media (max-width: 1024px) {
  .footer-top, .footer-top--contact { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-col--contact { grid-column: 1 / -1; display: block; }
  .footer-col--contact .footer-contact { grid-template-columns: repeat(2, auto); justify-content: start; gap: 10px 40px; }
}
@media (max-width: 768px) {
  .site-footer { padding: 60px 0 30px; }
  .footer-top, .footer-top--contact { grid-template-columns: 1fr; gap: 32px; }
  .footer-col--contact .footer-contact { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .legal-dns { padding-left: 0; }
  .legal-dns::before { display: none; }
}
