/* Shared header and footer for pages other than the homepage (see src/chrome.mjs).
   Values mirror the homepage's light theme in home.css. Class names are prefixed
   with hb- so they never collide with styles.css, shop.css or the Learn styles. */

.hb-nav,
.hb-footer {
  --hb-ink: #17332a;
  --hb-muted: #66746c;
  --hb-surface: #fbfaf5;
  --hb-green: #95d95a;
  --hb-green-ink: #286a42;
  --hb-deep: #17332a;
  --hb-on-deep: #f4f3e9;
  --hb-on-deep-muted: rgb(244 243 233 / 0.72);
  --hb-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --hb-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hb-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: var(--hb-body);
  -webkit-font-smoothing: antialiased;
}

.hb-nav *,
.hb-footer * {
  box-sizing: border-box;
}

/* Floating pill nav */
/* Sites with a full-bleed hero keep the pill floating over it, as their old header did */
.hb-nav.hb-nav-overlay {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 0;
  left: 0;
  margin-top: 0;
}

.hb-nav {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 50;
  margin-top: 12px;
  padding-inline: 16px;
  pointer-events: none;
}

.hb-nav-inner {
  display: flex;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 12px 10px 14px;
  align-items: center;
  gap: 24px;
  border: 1px solid rgb(23 51 42 / 0.1);
  border-radius: 999px;
  background: rgb(251 250 245 / 0.89);
  box-shadow: 0 12px 40px rgb(22 49 39 / 0.08);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.hb-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--hb-ink);
  font: 700 1.05rem var(--hb-display);
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.hb-brand svg {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
}

.hb-brand-by {
  white-space: nowrap;
  color: var(--hb-muted);
  font: 500 0.68rem/1 var(--hb-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hb-nav ul {
  display: flex;
  margin: 0 0 0 auto;
  padding: 0;
  gap: 30px;
  list-style: none;
}

.hb-nav ul a {
  white-space: nowrap;
  color: var(--hb-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.hb-nav ul a[aria-current="page"] {
  font-weight: 600;
}

.hb-btn {
  display: inline-flex;
  padding: 11px 19px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  background: var(--hb-ink);
  box-shadow: 0 10px 24px rgb(22 49 39 / 0.16);
  color: var(--hb-surface);
  font: 600 0.92rem var(--hb-body);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hb-btn:hover {
  background: var(--hb-green-ink);
  box-shadow: 0 14px 30px rgb(22 49 39 / 0.22);
  transform: translateY(-2px);
}

.hb-nav a:focus-visible,
.hb-footer a:focus-visible {
  outline: 3px solid var(--hb-green);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Dark footer */
.hb-footer {
  margin-top: 0;
  padding-block: 52px 64px;
  border-top: 1px solid rgb(255 255 255 / 0.08);
  background: var(--hb-deep);
  color: var(--hb-on-deep-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.hb-footer-inner {
  display: grid;
  max-width: 1220px;
  margin: 0 auto;
  padding-inline: clamp(20px, 4.5vw, 52px);
  gap: 18px;
}

.hb-footer p {
  max-width: none;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.hb-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hb-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--hb-on-deep);
  font: 700 1rem var(--hb-display);
  text-decoration: none;
}

.hb-footer-brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
}

.hb-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hb-social a {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.92);
}

.hb-social a:hover {
  background: var(--hb-green);
}

.hb-social img {
  display: block;
  width: 18px;
  height: 18px;
}

.hb-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.hb-footer nav a,
.hb-footer a.hb-mail {
  color: var(--hb-on-deep);
  text-decoration: none;
}

.hb-footer nav a:hover,
.hb-footer a.hb-mail:hover {
  color: var(--hb-green);
}

.hb-footer .hb-disclaimer {
  max-width: 80ch;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .hb-brand-by {
    display: none;
  }
}

@media (max-width: 860px) {
  .hb-nav ul {
    display: none;
  }

  .hb-nav-inner {
    padding: 8px 9px 8px 10px;
  }

  .hb-brand-by {
    display: none;
  }

  .hb-btn {
    margin-left: auto;
    font-size: 0.82rem;
  }
}

/* Narrow phones: longer labels such as "KOKO Research" plus a call to action
   must still fit inside the pill */
@media (max-width: 480px) {
  .hb-nav {
    padding-inline: 10px;
  }

  .hb-nav-inner {
    gap: 10px;
  }

  .hb-brand {
    min-width: 0;
    gap: 8px;
    font-size: 0.98rem;
  }

  .hb-brand svg {
    flex: none;
    width: 30px;
    height: 30px;
  }

  .hb-btn {
    padding: 9px 13px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hb-btn,
  .hb-nav ul a {
    transition: none;
  }

  .hb-btn:hover {
    transform: none;
  }
}
