/* ==========================================================================
   Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   The primary CTA is one of only two places the brand gradient is allowed
   (the other is quantified metrics). White on #1F61CC is 5.82:1, so the label
   passes AA against the darkest end of the gradient.
   Every variant clears the 44x44 minimum touch target.
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding-inline: 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease,
    scale 0.15s ease;
}

.btn:active {
  scale: 0.97;
}

.btn--primary {
  background-image: linear-gradient(100deg, var(--brand), var(--accent-deep));
  color: #fff;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.1),
    0 12px 32px -8px rgb(31 97 204 / 0.55);
}

.btn--primary:hover {
  filter: brightness(1.05);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.18),
    0 16px 40px -8px rgb(50 171 222 / 0.6);
}

.btn--secondary {
  background-color: var(--glass);
  border: 1px solid var(--glass-line-strong);
  color: var(--fg);
  backdrop-filter: blur(12px);
}

.btn--secondary:hover {
  background-color: rgb(255 255 255 / 0.1);
  border-color: rgb(255 255 255 / 0.25);
}

/* On a light band the polarity flips - cyan is unusable, brand blue is 5.77:1 */
.surface-light .btn--secondary {
  background-color: var(--surface);
  border-color: var(--hairline);
  color: var(--brand);
  backdrop-filter: none;
}

.surface-light .btn--secondary:hover {
  background-color: rgb(31 97 204 / 0.05);
  border-color: rgb(31 97 204 / 0.4);
}

.btn__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-pill);
  background-color: rgb(255 255 255 / 0.2);
  transition: translate 0.15s ease;
}

.btn:hover .btn__arrow {
  translate: 2px 0;
}

.btn__arrow svg {
  width: 0.875rem;
  height: 0.875rem;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

@media (min-width: 640px) {
  .btn-row {
    flex-direction: row;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Eyebrow - the glass pill badge above a heading, from the reference image
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-pill);
  background-color: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(12px);
  color: var(--fg-muted);
}

.eyebrow::before {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-pill);
  background-color: var(--accent);
}

.surface-light .eyebrow {
  background-color: var(--surface);
  border-color: var(--hairline);
  color: var(--accent-ink);
  backdrop-filter: none;
}

.surface-light .eyebrow::before {
  background-color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   Logo
   -------------------------------------------------------------------------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

/* The bird mark, cut out of the brand artwork (assets/img, 1x/2x/3x at
   exact size). 5:4, so height leads and width follows: 32px tall, 40px
   wide. A touch above the old 28px square mark - this one is more detailed
   and needs the room. */
.logo__mark {
  display: block;
  width: auto;
  height: 2rem;
  flex-shrink: 0;
}

.logo__word {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: var(--wdth-sub);
  font-size: 1.0625rem;
  letter-spacing: -0.025em;
  color: var(--fg);
}

/* The wordmark in the logo's own two colours: "Blue Jay" in the bird's blue,
   "Systems" in the pixel squares' cyan. The bird blue is only 2.6:1 on the
   dark header, which is allowed: WCAG 1.4.3 exempts text that is part of a
   logo or brand name. Automated checkers (Lighthouse/axe) cannot tell and
   will still flag it. */
.logo__brand {
  color: var(--logo-blue);
}

.logo__systems {
  color: var(--logo-cyan);
}

/* --------------------------------------------------------------------------
   Site nav - three detached parts floating below the top edge, per the
   reference image: logo left, a glass pill of links centred, CTA right.
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  padding-block: 1.25rem;
  transition: padding-block 0.3s ease;
}

.site-header__backdrop {
  position: absolute;
  inset: 0;
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    backdrop-filter 0.3s ease;
}

/* Applied by JS past 80px of scroll. */
.site-header.is-scrolled {
  padding-block: 0.75rem;
}

.site-header.is-scrolled .site-header__backdrop {
  /* Glass, kept genuinely see-through.

     The earlier fix here just raised opacity to 0.9, which fixed contrast by
     destroying the glass effect that the reference image is built on.

     This does it properly: backdrop-filter darkens whatever is behind BEFORE
     compositing, so the background still shows through - blurred and moving -
     but can never be light enough to strand the nav links. Worst case (pure
     white scrolling behind) composites to about #2C2E36, where --fg-muted
     computes to 5.28:1. Over the dark sections the bloom and grid stay
     visible through it, which is the whole point. */
  background-color: rgb(7 10 18 / 0.55);
  border-bottom-color: var(--glass-line);
  backdrop-filter: blur(16px) brightness(0.35) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) brightness(0.35) saturate(1.3);
}

.site-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.site-nav__pill {
  display: none;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem;
  border-radius: var(--radius-pill);
  background-color: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(12px);
}

/* In the flex row between the logo and the buttons rather than absolutely
   centred, so a longer link list can never slide underneath the buttons. */
@media (min-width: 1024px) {
  .site-nav__pill {
    display: flex;
  }
}

.site-nav__link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 2.25rem;
  padding-inline: 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  color: var(--fg-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav__link:hover {
  color: var(--fg);
}

.site-nav__link[aria-current='page'] {
  background-color: rgb(255 255 255 / 0.1);
  color: var(--fg);
  font-weight: 500;
}

.site-nav__link[aria-current='page']::before {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-pill);
  background-color: var(--accent);
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.site-nav__desktop-actions {
  display: none;
  align-items: center;
  gap: var(--sp-2);
}

@media (min-width: 640px) {
  .site-nav__desktop-actions {
    display: flex;
  }
}

.site-nav__signin {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.625rem;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  color: var(--fg-muted);
  transition: color 0.15s ease;
}

.site-nav__signin:hover {
  color: var(--fg);
}

/* The phone number reads as contact info, not a second button, so
   "Get a Demo" stays the one clear action in the bar. */
.site-nav__phone {
  gap: 0.375rem;
}

.site-nav__phone svg {
  width: 0.9375rem;
  height: 0.9375rem;
  flex-shrink: 0;
}

/* Logo + five links + phone + Log in + Get a Demo need ~995px of row; below
   1120px the phone number steps out - it stays in the mobile menu - so the
   row never crowds. */
@media (min-width: 1024px) and (max-width: 1119px) {
  .site-nav__phone {
    display: none;
  }
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-pill);
  background-color: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(12px);
  color: var(--fg);
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded='true'] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded='true'] .nav-toggle__close { display: block; }

.mobile-menu {
  position: relative;
  margin-inline: var(--gutter);
  margin-top: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--radius-card);
  border: 1px solid var(--glass-line);
  background-color: rgb(17 26 43 / 0.95);
  backdrop-filter: blur(16px);
}

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

@media (min-width: 1024px) {
  .mobile-menu {
    display: none;
  }
}

.mobile-menu__link {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding-inline: var(--sp-4);
  border-radius: 0.75rem;
  color: var(--fg-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.mobile-menu__link:hover {
  background-color: rgb(255 255 255 / 0.05);
  color: var(--fg);
}

.mobile-menu__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding: var(--sp-2);
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-line);
}

@media (min-width: 640px) {
  .mobile-menu__actions {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Metric - quantified figure in JetBrains Mono, the differentiating move.
   Count-up is an enhancement; the final value is in the markup so any
   failure path shows the true number rather than a stuck zero.
   -------------------------------------------------------------------------- */
.metric__value {
  color: var(--fg);
}

.metric__value--gradient {
  background-image: linear-gradient(100deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.metric__label {
  margin-top: 0.75rem;
  color: var(--fg-muted);
}

/* Light bands: ink figures, and the gradient ends on --accent-ink rather
   than --accent, which is only 2.62:1 on white. */
.surface-light .metric__value {
  color: var(--ink);
}

.surface-light .metric__value--gradient {
  background-image: linear-gradient(100deg, var(--brand), var(--accent-ink));
  color: transparent;
}

.surface-light .metric__label {
  color: var(--body-muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--glass-line);
  background-color: var(--base);
  padding-block: var(--sp-8);
}

.site-footer__grid {
  display: grid;
  gap: var(--sp-6);
}

@media (min-width: 1024px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
  }
}

.site-footer__blurb {
  margin-top: 1.25rem;
  max-width: 20rem;
  color: var(--fg-muted);
  font-size: 0.9375rem;
}

.site-footer__cols {
  display: grid;
  gap: var(--sp-6);
}

@media (min-width: 640px) {
  .site-footer__cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.site-footer__heading {
  color: var(--fg-dim);
}

.site-footer__links {
  margin-top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Product lists every homepage section plus Demo and Contact, so it runs in
   two columns filled top-to-bottom (six rows), and takes two of the three
   footer columns once there is room for three. */
.site-footer__links--split {
  display: grid;
  grid-template-rows: repeat(6, auto);
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  column-gap: var(--sp-5);
}

@media (min-width: 640px) {
  .site-footer__col--wide {
    grid-column: span 2;
  }
}

.site-footer__link {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  transition: color 0.15s ease;
}

.site-footer__link:hover {
  color: var(--fg);
}

.site-footer__base {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-top: var(--sp-7);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--glass-line);
  font-size: 0.8125rem;
  color: var(--fg-dim);
}

@media (min-width: 640px) {
  .site-footer__base {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* --------------------------------------------------------------------------
   Reveal

   The final state is the DEFAULT. The hidden state only applies once the
   inline head script has confirmed both JS and no reduced-motion preference,
   so with JS disabled or broken the page renders fully readable rather than
   invisible - and there is no flash of hidden content while GSAP loads.
   -------------------------------------------------------------------------- */
.js-reveal .reveal {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   Touch targets

   A 44x44 minimum is priority #2 in the UX checklist. Several links here are
   text-sized - footer links measured ~19px tall and the logo lockup 28px -
   which is fine under a mouse and too small for a thumb.

   Scoped to `pointer: coarse` so touch devices get the larger hit area while
   the visual rhythm on desktop stays as designed. The gap is removed where
   padding replaces it, so spacing looks unchanged.
   -------------------------------------------------------------------------- */
@media (pointer: coarse) {
  .site-footer__link,
  .mobile-menu__link,
  .site-nav__link,
  .site-nav__signin {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .site-footer__links {
    gap: 0;
  }

  .site-footer__legal {
    gap: 0 1.5rem;
  }

  .logo {
    min-height: 44px;
  }
}
