/* ==========================================================================
   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-lg);
  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. */
.brand img {
  height: 56px;
  width: auto;
  transition: height var(--dur-normal) var(--ease-out-expo);
}
.site-header[data-scrolled="true"] .brand img {
  height: 34px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 1vw, 1.25rem);
}

.nav__link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--brand-ink);
  white-space: nowrap;
  padding: 0.5rem 0.65rem;
  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: 940px) {
  .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: 46px;
  }
  .site-header[data-scrolled="true"] .brand img {
    height: 30px;
  }
}

@media (max-width: 560px) {
  .brand img {
    height: 42px;
  }
  .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: 940px) {

  .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);
  }
}

/* --- 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: 900;
  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.6fr repeat(3, 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: 52px;
  margin-bottom: var(--space-lg);
  background: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.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: -4160;
  }
}
