/* ==========================================================================
   Layout: header / nav / footer
   ========================================================================== */

/* --- Header --- */
/* Top of page: transparent with a white→transparent gradient so the hero
   wall stays visible and the large logo reads as part of the hero. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 26%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(255, 255, 255, 0.5) 74%,
    transparent 100%
  );
  border-bottom: 1px solid transparent;
  transition:
    background var(--dur-normal) ease,
    border-color var(--dur-normal),
    box-shadow var(--dur-normal),
    backdrop-filter var(--dur-normal);
}

/* On scroll: frosted glass, not solid white. */
.site-header[data-scrolled="true"] {
  background: color-mix(in oklch, var(--surface) 58%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: color-mix(in oklch, var(--line) 75%, transparent);
  box-shadow: 0 8px 26px -14px rgba(30, 42, 51, 0.22);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 96px;
  transition: height var(--dur-normal) var(--ease-out-expo);
}
.site-header[data-scrolled="true"] .site-header__inner {
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  margin-right: auto;
}

/* Big in the hero, shrinks into the bar on scroll. rem so it scales up on large
   monitors alongside the rest of the page. */
.brand img {
  height: 3.75rem;
  width: auto;
  transition: height var(--dur-normal) var(--ease-out-expo);
}
.site-header[data-scrolled="true"] .brand img {
  height: 2.5rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.1rem, 0.4vw, 0.55rem);
}

.nav__link {
  font-family: var(--font-display);
  font-weight: 500;
  /* a step up from --text-sm; nav collapses to the menu below 1240px */
  font-size: 0.95rem;
  color: var(--brand-ink);
  white-space: nowrap;
  padding: 0.5rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast), background var(--dur-fast);
}

.nav__link:hover {
  color: var(--brand-blue);
  background: var(--tint-blue-050);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand-ink);
  place-items: center;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

@media (max-width: 1240px) {
  .nav,
  .header-actions .btn--ghost {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .site-header__inner {
    gap: var(--space-sm);
    height: 82px;
  }
  .site-header[data-scrolled="true"] .site-header__inner {
    height: 58px;
  }
  .brand img {
    height: 54px;
  }
  .site-header[data-scrolled="true"] .brand img {
    height: 34px;
  }
}

@media (max-width: 560px) {
  .brand img {
    height: 48px;
  }
  .site-header[data-scrolled="true"] .brand img {
    height: 28px;
  }
  .header-actions .btn--accent {
    padding: 0.7em 1.05em;
    font-size: var(--text-sm);
  }
}

@media (max-width: 1240px) {

  .site-header[data-open="true"] .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-md) var(--gutter) var(--space-lg);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }

  .site-header[data-open="true"] .nav__link {
    padding: 0.9rem 0.5rem;
    border-bottom: 1px solid var(--line);
    font-size: var(--text-base);
  }
}

/* --- Mega menu (Solutions dropdown) --- */
.nav__item.has-mega {
  display: inline-flex;
  align-items: center;
}
.nav__link--mega {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.nav__caret {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-fast);
}
.has-mega:hover .nav__caret,
.has-mega:focus-within .nav__caret {
  transform: rotate(180deg);
}

.mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity var(--dur-fast) ease,
    transform var(--dur-normal) var(--ease-out-expo),
    visibility var(--dur-fast);
  z-index: 5;
}
.has-mega:hover .mega,
.has-mega:focus-within .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mega__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1.1fr;
  gap: clamp(1.5rem, 3vw, 3.25rem);
  padding-block: var(--space-xl);
}
/* compact variant for the Resources menu (2 link columns + feature) */
.mega--res .mega__inner {
  grid-template-columns: 1fr 1fr 1.3fr;
}
/* wide variant for the Solutions menu (Core + Framework + UC + PC + feature) */
.mega--sol .mega__inner {
  grid-template-columns: 1fr 0.8fr 1fr 1fr 1.15fr;
  gap: clamp(1.25rem, 2.4vw, 2.5rem);
}
.mega__col {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}
.mega__eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.mega__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast);
}
.mega__link:hover {
  background: var(--surface-2);
}
.mega__ic {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
}
.mega__ic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.mega__txt {
  display: grid;
}
.mega__txt b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--brand-ink);
}
.mega__txt em {
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--muted);
}
.mega__sub {
  font-size: var(--text-sm);
  color: var(--brand-ink);
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.mega__sub:hover {
  color: var(--brand-blue);
  background: var(--surface-2);
}
.mega__feature {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.mega__feature p {
  font-size: var(--text-sm);
  color: var(--muted);
}
.mega__feature .btn {
  justify-content: center;
}
.mega__all {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--brand-blue);
}

/* Mega on mobile: inline inside the open nav panel */
@media (max-width: 1240px) {
  .nav__item.has-mega {
    display: block;
    width: 100%;
  }
  .site-header[data-open="true"] .nav__link--mega {
    justify-content: space-between;
    padding: 0.9rem 0.5rem;
    border-bottom: 1px solid var(--line);
    font-size: var(--text-base);
  }
  .mega {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    background: transparent;
  }
  .mega__inner {
    display: block;
    padding: var(--space-sm) 0 var(--space-md) var(--space-md);
  }
  .mega__col {
    margin-bottom: var(--space-md);
  }
  .mega__feature {
    display: none;
  }
  .mega__ic {
    width: 28px;
    height: 28px;
  }
}

/* --- Footer (brand-blue, mega-CTA + giant wordmark + heartbeat) --- */
.site-footer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: rgba(255, 255, 255, 0.84);
  background-color: var(--brand-blue-900);
  padding-top: var(--space-2xl);
}
.site-footer a {
  color: rgba(255, 255, 255, 0.82);
  transition: color var(--dur-fast);
}
.site-footer a:hover {
  color: #fff;
}

/* mega CTA */
.footer-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);
  align-items: center;
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-cta h2 {
  color: #fff;
  font-size: var(--text-3xl);
  max-width: 16ch;
}
.footer-cta p {
  margin-top: var(--space-sm);
  color: rgba(255, 255, 255, 0.78);
  max-width: 46ch;
}
.footer-cta__actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .footer-cta {
    grid-template-columns: 1fr;
  }
}

/* proof strip */
.footer-stats {
  list-style: none;
  padding: 0 0 var(--space-2xl);
  margin: var(--space-xl) 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-stats b {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-2xl);
  line-height: 1;
  color: #fff;
}
.footer-stats span {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.66);
}
@media (max-width: 680px) {
  .footer-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg) var(--space-md);
  }
}

/* columns */
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: var(--space-xl) var(--space-lg);
  padding-block: var(--space-2xl);
}
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 460px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
.footer-brand img {
  display: block;
  width: auto;
  height: 4.75rem;
  margin-bottom: var(--space-lg);
  /* real white wordmark on the dark footer — no filter needed */
  opacity: 0.98;
}
.footer-brand p {
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--text-sm);
  max-width: 34ch;
}
.footer-col h4 {
  color: #fff;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}
.footer-col ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: var(--text-sm);
}

.footer-bottom {
  padding-block: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.62);
}

/* shared heartbeat sweep (used by section-head EKG lines) */
@keyframes ekg-sweep {
  to {
    stroke-dashoffset: -116;
  }
}
