.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 232, 0.96);
  font-family: var(--sans);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.nav-inner {
  position: relative;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 9px;
  color: var(--charcoal);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.brand svg {
  width: 29px;
  height: 29px;
  /* the desktop app's mark colour (packages/ui mist tone --green-primary) */
  color: #1d9e82;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
}

.nav-links a {
  padding-block: 12px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--green);
}

.nav-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
}

.language-switch {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  color: var(--green);
  font-weight: 650;
}

.language-switch:hover {
  color: var(--forest);
}

.download {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border-radius: 8px;
  color: var(--cream-light);
  background: var(--forest);
  font-family: var(--sans);
  font-weight: 650;
  transition: background-color 160ms ease, transform 160ms ease;
}

.download:hover {
  background: var(--green);
  transform: translateY(-1px);
}

.mobile-menu {
  display: none;
  width: 42px;
  height: 42px;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--charcoal);
  background: transparent;
  cursor: pointer;
}

.mobile-menu span {
  display: block;
  width: 17px;
  height: 1px;
  background: currentColor;
  transition: transform 160ms ease;
}

.mobile-menu[aria-expanded="true"] span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.mobile-menu[aria-expanded="true"] span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

footer {
  padding: 78px 0 52px;
  color: rgba(244, 241, 232, 0.64);
  background: var(--footer-ink);
  font-family: var(--sans);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 76px;
  align-items: start;
}

.footer-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.footer-brand-lockup svg {
  width: 29px;
  height: 29px;
  /* the app's mark colour on dark surfaces (packages/ui dark mist --green-primary) */
  color: #38c08b;
}

.footer-tagline {
  max-width: 230px;
  margin: 19px 0 0;
  line-height: 1.75;
}

.footer-heading {
  margin: 3px 0 21px;
  color: rgba(244, 241, 232, 0.42);
  font-size: 13px;
  font-weight: 500;
}

.footer-list {
  display: grid;
  gap: 14px;
}

.footer-item {
  color: rgba(244, 241, 232, 0.7);
  line-height: 1.5;
}

a.footer-item:hover {
  color: var(--cream);
}

.footer-bottom {
  margin-top: 66px;
  padding-top: 28px;
  border-top: 1px solid rgba(244, 241, 232, 0.14);
  color: rgba(244, 241, 232, 0.46);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .nav-links {
    gap: 20px;
  }
}

@media (max-width: 840px) {
  .nav-links {
    position: absolute;
    top: 72px;
    left: 50%;
    width: 100vw;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 10px max(20px, calc((100vw - var(--max)) / 2)) 18px;
    border-bottom: 1px solid var(--line);
    background: var(--cream);
    box-shadow: 0 14px 28px rgba(34, 57, 47, 0.08);
    transform: translateX(-50%);
  }

  .nav-links[data-open="true"] {
    display: flex;
  }

  .nav-links a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .nav-actions {
    margin-left: auto;
    gap: 9px;
  }

  .mobile-menu {
    display: grid;
  }
}

@media (max-width: 760px) {
  .nav-inner {
    min-height: 68px;
  }

  .nav-links {
    top: 68px;
  }

  .download {
    min-height: 40px;
    padding: 0 14px;
  }

  footer {
    padding: 68px 0 42px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px 34px;
  }

  .footer-brand-column {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    margin-top: 52px;
  }
}

@media (max-width: 410px) {
  .brand {
    font-size: 19px;
  }

  .brand svg {
    width: 27px;
    height: 27px;
  }

  .language-switch,
  .download {
    font-size: 13px;
  }

  .download {
    padding-inline: 12px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .footer-brand-column {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu span,
  .download {
    transition-duration: 0.01ms !important;
  }
}
