/* PatternSpace — shared site chrome (top nav + footer).
 *
 * SINGLE SOURCE OF TRUTH for the nav bar and footer, linked by EVERY page
 * (the homepage's inline styles and shared.css both defer to this file).
 * Relies on design tokens (--text, --text2, --text3, --border, --bg2) being
 * defined by the page's own :root — every page defines them.
 *
 * Do not duplicate these rules elsewhere. `web/scripts/check-nav.py` guards the
 * nav/footer *markup*; keeping the styling here keeps it from drifting too. */

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 60px;
  background: oklch(11% 0.012 260 / 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}
.nav-brand span {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-links a.active {
  color: var(--text);
}

.app-store-badge {
  display: inline-block;
  width: 180px;
  max-width: 100%;
  text-decoration: none;
  transition: transform 0.15s;
}
.app-store-badge img {
  display: block;
  width: 100%;
  height: auto;
}
.nav-store-badge {
  width: 135px;
  flex-shrink: 0;
}
.app-store-badge:hover {
  transform: translateY(-1px);
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}
.nav-toggle:hover {
  background: oklch(100% 0 0 / 0.06);
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text2);
  border-radius: 2px;
  transition:
    transform 0.25s,
    opacity 0.2s,
    width 0.2s;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav drawer — hidden at every width until opened */
nav.nav-drawer {
  top: 60px;
  bottom: auto;
  height: auto;
  padding: 16px 24px 24px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
}

/* ── FOOTER ── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}
.footer-brand span {
  font-size: 13px;
  color: var(--text2);
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 12px;
  color: var(--text3);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--text2);
}
.footer-copy {
  font-size: 12px;
  color: var(--text3);
}

/* ── RESPONSIVE (nav + footer) ── */

/* Tablet */
@media (max-width: 860px) {
  nav {
    padding: 0 24px;
  }

  .nav-links {
    display: none;
  }
  .nav-store-badge {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }

  /* Mobile nav drawer */
  .nav-drawer {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: oklch(11% 0.012 260 / 0.97);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 99;
  }
  .nav-drawer.open {
    display: flex;
  }
  .nav-drawer a {
    color: var(--text2);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    transition: color 0.15s;
  }
  .nav-drawer a:last-child {
    border-bottom: none;
  }
  .nav-drawer a:hover,
  .nav-drawer a.active {
    color: var(--text);
  }
  .nav-drawer .nav-drawer-cta {
    margin-top: 12px;
    display: inline-block;
    width: 180px;
    padding: 0;
    border-bottom: none;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
    gap: 20px;
  }
  .footer-links {
    gap: 16px;
  }
}

/* Mobile */
@media (max-width: 540px) {
  footer {
    padding: 28px 16px;
  }
  .footer-links {
    gap: 12px;
    flex-wrap: wrap;
  }
}
