/* Site navigation — floating glass pill that tightens on scroll */
:root {
  --sn-h: 64px;
  --sn-top: 14px;
  --sn-w: var(--rail);
  --sn-w-sm: max(660px, calc(var(--rail) * 0.84));
  --sn-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sn-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --sn-ring: rgba(10, 92, 184, 0.4);
}

html {
  scroll-padding-top: calc(80px + env(safe-area-inset-top, 0px));
}

html.sn-lock,
html.sn-lock body {
  overflow: hidden;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font: 600 14px/1 Inter, system-ui, sans-serif;
  transform: translateY(calc(-100% - 40px));
  transition: transform 0.2s ease-out;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  box-shadow: 0 10px 30px rgba(11, 31, 77, 0.25);
  outline: 2px solid var(--sn-ring);
  outline-offset: 2px;
}

#main-content:focus {
  outline: none;
}

/* Bar */
.site-nav {
  position: fixed;
  top: calc(var(--sn-top) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 90;
  font-family: Inter, "Plus Jakarta Sans", system-ui, sans-serif;
  pointer-events: none;
  transition: top 0.5s var(--sn-ease);
}

.sn-in {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: var(--sn-w);
  max-width: 100%;
  height: var(--sn-h);
  margin: 0 auto;
  padding: 0 10px 0 22px;
  border-radius: 999px;
  overflow: hidden;
  pointer-events: auto;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(10, 92, 184, 0.06),
    0 10px 34px -14px rgba(10, 60, 140, 0.28);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  transition:
    width 0.55s var(--sn-ease),
    height 0.45s var(--sn-ease),
    padding 0.45s var(--sn-ease),
    background-color 0.3s ease-out,
    box-shadow 0.45s var(--sn-ease);
  animation: navDrop 0.8s var(--sn-ease) both;
}

.site-nav.is-scrolled .sn-in {
  width: var(--sn-w-sm);
  padding: 0 10px 0 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(10, 92, 184, 0.08),
    0 18px 44px -16px rgba(10, 60, 140, 0.38);
}

/* Shine that sweeps across the glass whenever the bar tightens */
.sn-in::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  transform: translateX(-120%);
}

.site-nav.is-scrolled .sn-in::after {
  animation: snShine 1.1s var(--sn-ease) 0.1s;
}

@keyframes snShine {
  to { transform: translateX(120%); }
}

/* Logo */
.sn-logo {
  display: flex;
  align-items: center;
  justify-self: start;
  border-radius: 12px;
}

.sn-logo img {
  display: block;
  height: 48px;
  width: auto;
  transition: transform 0.3s var(--sn-ease);
}

.sn-logo:hover img {
  transform: scale(1.04);
}

/* Links with sliding highlight */
.sn-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}

.sn-ind {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--ind-w, 0);
  height: var(--ind-h, 0);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(10, 139, 224, 0.14), rgba(10, 92, 184, 0.1));
  box-shadow: inset 0 0 0 1px rgba(10, 92, 184, 0.1);
  transform: translate(var(--ind-x, 0), var(--ind-y, 0));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.45s var(--sn-spring),
    width 0.45s var(--sn-spring),
    height 0.3s var(--sn-ease),
    opacity 0.25s ease-out;
}

.sn-ind.is-on {
  opacity: 1;
}

.sn-links a {
  position: relative;
  z-index: 1;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 20px;
  white-space: nowrap;
  color: var(--navy);
  opacity: 0.72;
  transition:
    opacity 0.2s ease-out,
    color 0.2s ease-out,
    padding 0.45s var(--sn-ease);
}

.sn-links a:hover {
  opacity: 1;
}

.sn-links a[aria-current="page"] {
  opacity: 1;
  color: var(--blue);
  font-weight: 600;
}

/* Right side */
.sn-right {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.sn-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px 0 13px;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #2fe077, #1fbf5b);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 20px -8px rgba(31, 191, 91, 0.7);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    filter 0.28s ease,
    padding 0.45s var(--sn-ease);
}

.sn-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45);
  pointer-events: none;
  z-index: 0;
}

.sn-cta::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -40%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
  z-index: 1;
}

.site-nav.is-scrolled .sn-cta {
  padding: 0 12px;
}

.site-nav.is-scrolled .sn-cta::before {
  animation: snPulse 2.6s ease-out 0.6s infinite;
}

@keyframes snPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
}

.sn-cta:hover {
  transform: translateY(-4px) scale(1.02);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 16px 36px rgba(31, 191, 91, 0.48);
}

.sn-cta:hover::after {
  animation: btnShine 0.85s ease;
}

.sn-cta > * {
  position: relative;
  z-index: 2;
}

.sn-wa {
  width: 20px;
  height: 20px;
  flex: none;
  transition: transform 0.45s var(--sn-spring);
}

.site-nav.is-scrolled .sn-wa {
  transform: rotate(-8deg) scale(1.05);
}

.sn-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 120px;
  margin-left: 8px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-width 0.45s var(--sn-ease),
    margin 0.45s var(--sn-ease),
    opacity 0.25s ease-out 0.1s;
}

.site-nav.is-scrolled .sn-label {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  transition:
    max-width 0.45s var(--sn-ease),
    margin 0.45s var(--sn-ease),
    opacity 0.15s ease-out;
}

.sn-arrow {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 0.2s ease-out;
}

.sn-cta:hover .sn-arrow {
  transform: translateX(3px);
}

/* Focus ring */
.sn-logo:focus-visible,
.sn-links a:focus-visible,
.sn-cta:focus-visible,
.sn-burger:focus-visible,
.sn-menu-links a:focus-visible {
  outline: 2px solid var(--sn-ring);
  outline-offset: 2px;
}

/* Hamburger → X */
.sn-burger {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 92, 184, 0.08);
  color: var(--navy);
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.sn-burger:hover {
  background: rgba(10, 92, 184, 0.14);
}

.sn-burger span {
  position: absolute;
  left: 11px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition:
    transform 0.35s var(--sn-ease),
    opacity 0.2s ease-out;
}

.sn-burger span:nth-child(1) { top: 13px; }
.sn-burger span:nth-child(2) { top: 19px; }
.sn-burger span:nth-child(3) { top: 25px; }

.sn-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.sn-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.3);
}

.sn-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.sn-menu {
  display: none;
}

/* Hero readability veil under the bar */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}

/* Back to top — liquid fill rises with scroll progress */
.to-top {
  --p: 0;
  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, #0d4fa8, #072f6e 75%);
  box-shadow:
    0 14px 32px -12px rgba(7, 47, 110, 0.6),
    0 0 0 4px rgba(10, 139, 224, 0.12);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px) scale(0.5);
  transition:
    opacity 0.3s ease-out,
    transform 0.6s var(--sn-spring),
    box-shadow 0.3s ease-out;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.to-top.is-visible:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow:
    0 20px 40px -12px rgba(7, 47, 110, 0.7),
    0 0 0 6px rgba(10, 139, 224, 0.18);
}

.to-top.is-visible:active {
  transform: scale(0.94);
}

.to-top:focus-visible {
  outline: 2px solid var(--sn-ring);
  outline-offset: 3px;
}

.tt-liquid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #25c4f0, #0a8be0 60%, #7ab51d 140%);
  transform: translateY(calc((1 - var(--p)) * 100% + 6px));
  transition: transform 0.25s ease-out;
}

.tt-wave {
  position: absolute;
  left: 0;
  bottom: 100%;
  width: 200%;
  height: 8px;
  margin-bottom: -1px;
  fill: #25c4f0;
  animation: ttWave 1.8s linear infinite;
}

@keyframes ttWave {
  to { transform: translateX(-50%); }
}

.tt-arrow {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 3px rgba(4, 30, 80, 0.35));
}

.to-top.is-visible:hover .tt-arrow {
  animation: ttHop 0.9s var(--sn-ease) infinite;
}

.to-top.is-visible.is-launch .tt-arrow {
  animation: ttFly 0.6s var(--sn-ease);
}

@keyframes ttHop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-3px); }
}

@keyframes ttFly {
  0% { transform: translateY(0); opacity: 1; }
  45% { transform: translateY(-180%); opacity: 0; }
  46% { transform: translateY(180%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@media (max-width: 1100px) {
  :root {
    --sn-w: calc(100% - 32px);
    --sn-w-sm: max(640px, calc((100% - 32px) * 0.86));
  }
}

@media (max-width: 1023px) {
  .sn-in {
    gap: 8px;
    padding-left: 18px;
  }

  .sn-links a {
    padding: 6px 10px;
    font-size: 13.5px;
  }

  .sn-logo img {
    height: 44px;
  }
}

@media (max-width: 900px) {
  .hero .copy {
    padding-top: calc(var(--sn-top) + 64px + 22px);
  }
}

@media (max-width: 767px) {
  :root {
    --sn-top: 10px;
    --sn-w: calc(100% - 20px);
    --sn-w-sm: calc(100% - 40px);
  }

  .sn-in,
  .site-nav.is-scrolled .sn-in {
    grid-template-columns: 1fr auto;
    padding: 0 6px 0 14px;
  }

  .sn-links {
    display: none;
  }

  .to-top {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 50px;
    height: 50px;
  }

  .sn-burger {
    display: block;
  }

  .sn-cta {
    height: 40px;
  }

  .site-nav.is-scrolled .sn-cta {
    padding: 0 10px;
  }

  .sn-logo img {
    height: 40px;
  }

  .sn-menu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 85;
    padding: calc(var(--sn-top) + 64px + 28px) 24px 32px;
    overflow-y: auto;
    background:
      radial-gradient(ellipse 80% 50% at 100% 0%, rgba(171, 224, 253, 0.55), transparent 70%),
      rgba(246, 250, 255, 0.86);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    opacity: 0;
    visibility: hidden;
    clip-path: circle(0 at calc(100% - 36px) 36px);
    transition:
      opacity 0.35s ease-out,
      clip-path 0.55s var(--sn-ease),
      visibility 0s linear 0.55s;
  }

  .sn-menu.is-open {
    opacity: 1;
    visibility: visible;
    clip-path: circle(150% at calc(100% - 36px) 36px);
    transition:
      opacity 0.3s ease-out,
      clip-path 0.6s var(--sn-ease),
      visibility 0s;
  }

  .sn-menu-links {
    display: flex;
    flex-direction: column;
    font-family: Inter, "Plus Jakarta Sans", system-ui, sans-serif;
  }

  .sn-menu-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px;
    border-bottom: 1px solid rgba(11, 31, 77, 0.08);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--navy);
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 0.4s ease-out,
      transform 0.5s var(--sn-ease),
      color 0.2s ease-out;
  }

  .sn-menu-links a::after {
    content: "";
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.35;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  }

  .sn-menu-links a:hover,
  .sn-menu-links a[aria-current="page"] {
    color: var(--blue);
  }

  .sn-menu-links a:hover::after,
  .sn-menu-links a[aria-current="page"]::after {
    opacity: 1;
    transform: translateX(3px) rotate(45deg);
  }

  .sn-menu.is-open .sn-menu-links a {
    opacity: 1;
    transform: none;
    transition-delay: calc(120ms + var(--i, 0) * 50ms), calc(120ms + var(--i, 0) * 50ms), 0s;
  }
}

@media (max-width: 359px) {
  .sn-label {
    max-width: 0;
    margin-left: 0;
    opacity: 0;
  }

  .sn-cta {
    padding: 0 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .site-nav *,
  .site-nav *::before,
  .site-nav *::after,
  .skip-link,
  .sn-menu,
  .sn-menu-links a,
  .to-top,
  .to-top * {
    animation: none !important;
    transition: none !important;
  }

  .to-top.is-visible:hover,
  .to-top.is-visible:active {
    transform: none;
  }

  .sn-cta:hover,
  .sn-cta:hover .sn-arrow,
  .sn-logo:hover img {
    transform: none;
  }

  .sn-cta:hover::after {
    animation: none;
  }
}
