/* ==========================================================================
   Site navigation
   The glass navbar, shared by every page that has one: index.html and the
   legal / support documents. Loaded on its own, it is self-contained - it
   declares the handful of design tokens it needs on :root and depends only
   on css/reset.css and the --color-* palette in css/styles.css.

   css/home.css builds on these same tokens and primitives, so on the home
   page this file must be linked BEFORE css/home.css.

   The bar is position:fixed and therefore takes no layout space. The home
   hero allows for it in its own top padding; every other page puts
   .tk-nav-offset on <main>.
   ========================================================================== */

:root {
  /* bar metrics: 3.5rem pill + 0.75rem of breathing room above and below */
  --tk-nav-h: 4.5rem;
  --tk-nav-offset: 5rem;

  /* ink */
  --tk-fg: #191735;
  --tk-fg-soft: #56547A;

  /* hairlines */
  --tk-line: rgba(13, 9, 48, 0.08);
  --tk-line-strong: rgba(77, 66, 254, 0.16);

  /* shape */
  --tk-r-sm: 12px;
  --tk-r-lg: 26px;

  /* elevation - indigo-tinted, never neutral grey */
  --tk-shadow-sm: 0 1px 2px rgba(13, 9, 48, 0.05), 0 4px 12px rgba(13, 9, 48, 0.05);
  --tk-shadow-lg: 0 4px 10px rgba(13, 9, 48, 0.06), 0 30px 70px rgba(13, 9, 48, 0.14);

  --tk-grad: linear-gradient(120deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --tk-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* The page gutter. Shared so the bar lines up with whatever sits under it. */
.tk-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
}

/* The opening band of a page the bar floats over. It keeps its own
   background and runs up behind the bar - that is what gives the glass
   something to sit on - and absorbs the height the bar would have occupied
   into its top padding. The home hero does the same thing in css/home.css.
   Element + class, so it wins over whatever padding the band declares for
   itself regardless of stylesheet order. */
section.tk-nav-under {
  padding-top: calc(var(--tk-nav-offset) + clamp(2rem, 5vw, 4rem));
}

/* ==========================================================================
   Buttons, links, store badges
   ========================================================================== */

.tk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9375rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--tk-ease), box-shadow 0.25s var(--tk-ease),
    background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.tk-btn__arrow {
  transition: transform 0.25s var(--tk-ease);
}

.tk-btn:hover .tk-btn__arrow {
  transform: translateX(3px);
}

.tk-btn--primary {
  background-image: var(--tk-grad);
  color: var(--color-white);
  box-shadow: 0 6px 16px rgba(77, 66, 254, 0.28), 0 2px 4px rgba(77, 66, 254, 0.2);
}

.tk-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(77, 66, 254, 0.34), 0 3px 6px rgba(77, 66, 254, 0.22);
}

.tk-btn--ghost {
  border-color: var(--tk-line-strong);
  background-color: rgba(255, 255, 255, 0.8);
  color: var(--tk-fg);
  box-shadow: var(--tk-shadow-sm);
}

.tk-btn--ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 66, 254, 0.34);
  color: var(--color-primary);
}

.tk-btn--light {
  background-color: var(--color-white);
  color: var(--color-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.tk-btn--light:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.tk-btn--sm {
  padding: 0.6875rem 1.125rem;
  font-size: 0.875rem;
}

.tk-btn:active {
  transform: translateY(0) scale(0.985);
}

/* --- app store badges -------------------------------------------------- */

.tk-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tk-store {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 4px 14px rgba(13, 9, 48, 0.16);
  transition: transform 0.25s var(--tk-ease), box-shadow 0.25s var(--tk-ease);
}

.tk-store img {
  height: 2.875rem;
  width: auto;
}

.tk-store:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 26px rgba(13, 9, 48, 0.26);
}

.tk-store:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* 1px probe at the very top of the document. The navbar watches it with an
   IntersectionObserver instead of listening to scroll. Needs a real box -
   a zero-area inline element is not reliably reported as intersecting. */
[data-nav-sentinel] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  pointer-events: none;
}

.tk-skip {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -150%);
  z-index: 300;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--tk-r-sm) var(--tk-r-sm);
  background-color: var(--color-primary);
  color: var(--color-white);
  font-weight: 600;
  transition: transform 0.2s ease;
}

.tk-skip:focus {
  transform: translate(-50%, 0);
}

/* --- focus -------------------------------------------------------------
   reset.css gives links no visible affordance, so the bar states its own
   focus ring rather than relying on a page-level rule.                    */

.tk-nav a:focus-visible,
.tk-nav button:focus-visible,
.tk-skip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ==========================================================================
   Navigation
   A glass pill that sits over the hero and firms up on scroll.
   ========================================================================== */

.tk-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 0.75rem 0;
  transition: padding 0.3s var(--tk-ease);
}

.tk-nav__inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  height: 3.5rem;
  padding: 0 0.6rem 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 1px 2px rgba(13, 9, 48, 0.03);
  transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.tk-nav.is-stuck .tk-nav__inner {
  border-color: rgba(13, 9, 48, 0.07);
  background-color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(13, 9, 48, 0.04), 0 10px 30px rgba(13, 9, 48, 0.09);
}

.tk-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--tk-fg);
}

.tk-brand img {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(77, 66, 254, 0.3);
}

.tk-nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 1.4vw, 1rem);
  margin-left: auto;
}

.tk-nav__links a {
  display: block;
  position: relative;
  padding: 0.5rem 0.6875rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tk-fg-soft);
  transition: color 0.25s ease, background-color 0.25s ease;
}

.tk-nav__links a:hover,
.tk-nav__links a.is-current {
  color: var(--color-primary);
  background-color: rgba(77, 66, 254, 0.08);
}

.tk-nav__cta {
  margin-left: 0.25rem;
  flex-shrink: 0;
}

.tk-nav__burger {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: auto;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: background-color 0.25s ease;
}

.tk-nav__burger:hover {
  background-color: rgba(77, 66, 254, 0.08);
}

.tk-nav__burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--tk-fg);
  transition: transform 0.3s var(--tk-ease), opacity 0.2s ease;
}

.tk-nav__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.tk-nav__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.tk-nav__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- mobile sheet ------------------------------------------------------ */

.tk-nav__sheet {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: clamp(1.15rem, 4vw, 2rem);
  right: clamp(1.15rem, 4vw, 2rem);
  padding: 0.5rem;
  border: 1px solid rgba(13, 9, 48, 0.07);
  border-radius: var(--tk-r-lg);
  background-color: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--tk-shadow-lg);
  transform-origin: top center;
  transition: opacity 0.26s var(--tk-ease), transform 0.26s var(--tk-ease),
    visibility 0s linear 0.26s;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.985);
  display: none;
}

.tk-nav.is-open .tk-nav__sheet {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.tk-nav__sheet ul {
  display: grid;
  gap: 2px;
}

.tk-nav__sheet a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-radius: var(--tk-r-sm);
  font-size: 1rem;
  font-weight: 500;
  color: var(--tk-fg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tk-nav__sheet a:hover {
  background-color: rgba(77, 66, 254, 0.07);
  color: var(--color-primary);
}

.tk-nav__sheet-foot {
  display: grid;
  gap: 0.875rem;
  padding: 0.875rem 1rem 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--tk-line);
}

.tk-nav__sheet-foot .tk-btn {
  width: 100%;
}

.tk-nav__sheet-foot .tk-stores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}

.tk-nav__sheet-foot .tk-store img {
  width: 100%;
  height: auto;
}

@media (max-width: 1040px) {
  .tk-nav__links,
  .tk-nav__cta {
    display: none;
  }

  .tk-nav__burger {
    display: flex;
  }

  .tk-nav__sheet {
    display: block;
  }
}

/* ==========================================================================
   Reduced motion - the bar still changes state, it just stops sliding
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .tk-nav,
  .tk-nav *,
  .tk-skip {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
