/*
  Shared site chrome — identical on every page (landing + legal).
  Logo left · primary nav + menu toggle right · fixed for full scroll.
  (fixed, not sticky — body overflow-x would otherwise unpin sticky)
*/
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5000;
  width: 100%;
  transform: none !important;
}

/* Reserve space so content never sits under the fixed bar */
body.landing-page,
body.page-wash {
  padding-top: var(--header-h);
}

.site-header {
  position: relative;
  z-index: 1;
  min-height: var(--header-h);
  height: auto;
  padding: 0.55rem 0;
  box-sizing: border-box;
  background: var(--white);
  border-bottom: 1px solid rgba(226, 228, 239, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-page .site-header,
.page-wash .site-header {
  background: var(--white);
}

.site-header__inner {
  position: relative;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
}

.primary-nav {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 0.2rem;
  margin-left: auto;
}

.primary-nav a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.primary-nav a:hover {
  color: var(--lavender);
  background: var(--sky-soft);
}

.primary-nav a.is-active {
  color: var(--cta-pink);
  background: var(--pink-soft);
  font-weight: 700;
}

/* Desktop / tablet: nav sits on the right, before hamburger */
@media (min-width: 860px) {
  .primary-nav {
    display: flex;
    position: static;
    left: auto;
    top: auto;
    transform: none;
    margin-left: auto;
  }

  .site-header__inner .menu-toggle {
    margin-left: 0.15rem;
    flex-shrink: 0;
  }
}

/* Narrow screens: logo + menu only (same header bar) */
@media (max-width: 859px) {
  .site-header {
    padding: 0.35rem 0;
  }

  .site-header__inner .menu-toggle {
    margin-left: auto;
  }
}

body.menu-open {
  overflow: hidden;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  min-height: 34px;
}

/* Match mobile app header: full puzzle mark + Partneryn word on one line */
.brand__mark {
  height: 36px;
  width: auto;
  aspect-ratio: 788 / 494;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  display: block;
  overflow: visible;
  max-width: none;
}

.brand__mark--drawer {
  height: 30px;
}

/* Legacy lockup class (kept if referenced) */
.brand__lockup {
  height: 28px;
  width: auto;
  aspect-ratio: 2096 / 393;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
  display: block;
  overflow: visible;
  color: #1a1a2e;
}

.brand__lockup--drawer {
  height: 30px;
}

.brand__word {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  color: var(--lavender);
}

.brand__word span {
  color: var(--pink);
}

.menu-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
  background: var(--soft-grey);
}

.menu-toggle__bars {
  width: 16px;
  height: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.28);
  backdrop-filter: blur(2px);
  z-index: 10000;
}

.site-drawer {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  width: min(320px, calc(100vw - 1.5rem));
  max-width: 100%;
  background: var(--white);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--soft-grey);
  z-index: 10001;
  padding: 0.85rem 0.9rem 1.25rem;
  overflow-x: hidden;
  overflow-y: auto;
  /* hide scrollbar; keep scroll (touch / wheel) */
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform: translateX(110%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s;
  -webkit-overflow-scrolling: touch;
}

.site-drawer::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.site-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.site-drawer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.site-drawer__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.site-drawer__brand img.brand__mark {
  width: auto;
  height: 30px;
  aspect-ratio: 788 / 494;
  object-fit: contain;
  flex-shrink: 0;
  overflow: visible;
}

.site-drawer__wordmark {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--lavender);
  margin: 0;
}

.site-drawer__wordmark span {
  color: var(--pink);
}

.site-drawer__tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.15rem;
}

.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--wash);
  color: var(--ink-soft);
}

.drawer-close:hover {
  background: var(--soft-grey);
}

.site-drawer__primary,
.site-drawer__legal {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-drawer__primary {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--soft-grey);
}

/* After the flex rules so this wins: desktop drawer = Help & Legal only */
@media (min-width: 860px) {
  .site-drawer__primary {
    display: none !important;
  }
}

.help-menu__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky);
  margin: 0.35rem 0 0.55rem 0.45rem;
}

.site-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 0.65rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.site-drawer a:hover,
.site-drawer a.is-active {
  background: var(--pink-soft);
  color: var(--cta-pink);
}

.site-drawer a svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.header-shell {
  position: relative;
  flex: 0 1 auto;
  width: min(100% - 2rem, var(--max));
  max-width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  background: var(--white);
  border-top: 1px solid var(--soft-grey);
  padding: 2.75rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, 1fr);
  gap: 1.75rem 1.25rem;
}

.footer-brand .site-footer__copy {
  margin: 0.75rem 0 1rem;
}

.footer-col__title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000000;
  margin: 0 0 0.75rem;
}

.footer-col__links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-col__links a {
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-col__links a:hover {
  color: var(--lavender);
}

.site-footer__copy {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer__social {
  display: flex;
  gap: 0.55rem;
}

.site-footer__social a {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid var(--soft-grey);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.site-footer__social a svg {
  display: block;
}

.site-footer__social a:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 1000px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer {
    margin-top: 2.5rem;
    padding: 2rem 0 1.75rem;
  }
}

@media (max-width: 420px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Legal page grid */
.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding: 1.5rem 0 3rem;
  width: 100%;
  max-width: 100%;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 228, 239, 0.9);
  padding: 1.15rem 0.9rem;
  max-width: 100%;
}

.toc__title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.65rem;
  padding-inline: 0.55rem;
}

.toc a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.toc a:hover {
  color: var(--ink-soft);
  background: var(--wash);
}

.toc a.is-active {
  background: var(--pink-soft);
  color: var(--cta-pink);
  font-weight: 700;
}

.legal-main {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1rem 0 2.5rem;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 560px) {
  .site-drawer {
    top: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
    border-radius: 18px;
  }

  .brand__word {
    font-size: 1.05rem;
  }

  .brand__mark {
    height: 28px;
    width: auto;
    aspect-ratio: 788 / 494;
  }
}
