/* How It Heals — shared site shell (topbar, drawer, footer).
   Lifted from male-biological-reset.html. Every custom property is prefixed
   --hih- so a page that defines its own --ink / --rule / --mono cannot bleed
   into the nav. Loaded after the page's own stylesheet. */

:root {
  --hih-cream:      oklch(1 0 0);
  --hih-ink:        oklch(0.20 0.006 250);
  --hih-ink-mute:   oklch(0.42 0.006 250);
  --hih-ink-faint:  oklch(0.62 0.005 250);
  --hih-rule:       oklch(0.885 0.004 250);
  --hih-terra:      #242628;
  --hih-btn:        #FDF4CB;
  --hih-btn-hover:  #F8E7A0;
  --hih-btn-edge:   #E2CF80;
  --hih-btn-ink:    #141719;
  --hih-terra-deep: #141719;
  --hih-terra-soft: #FDF4CB;
  --hih-radius-btn: 10px;
  --hih-shell-pad:  clamp(1.25rem, 4vw, 3rem);
  --hih-topbar-h:   clamp(72px, 5vw + 56px, 92px);
  --hih-sans:       'Geist', system-ui, sans-serif;
  --hih-mono:       'Geist Mono', 'Geist Mono', ui-monospace, monospace;
}

/* the pages this is dropped into have their own resets and their own link
   colours; re-assert what the nav assumes, scoped so nothing else moves. */
.topbar, .topbar *, .drawer, .drawer *, .foot, .foot * { box-sizing: border-box; }
.topbar ul, .topbar li, .drawer ul, .drawer li {
  margin: 0; padding: 0; list-style: none;
}
.topbar, .drawer { font-family: var(--hih-sans); line-height: 1.55; }
.topbar a, .drawer a, .drawer button { color: inherit; text-decoration: none; }
.foot a { text-decoration: none; }
.topbar svg, .drawer svg { display: block; }

/* ── topbar ── */
.topbar { position: sticky; top: 0; z-index: 80; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(1rem, 2vw, 2.5rem); padding: clamp(1.1rem, 1vw + 0.6rem, 1.6rem) var(--hih-shell-pad); min-height: var(--hih-topbar-h); background: oklch(1 0 0 / 0.92); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--hih-rule); transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); will-change: transform; }

/* ── topbar chrome ── */
.brand-mark { display: inline-flex; align-items: center; color: var(--hih-ink); }
.brand-mark svg { height: clamp(22px, 1vw + 16px, 28px); width: auto; }
.topbar-nav { display: flex; align-items: center; justify-content: center; gap: clamp(0.85rem, 1.4vw, 1.75rem); list-style: none; }
.topbar-nav a { font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--hih-ink-mute); position: relative; padding-bottom: 2px; transition: color 0.4s; white-space: nowrap; }
.topbar-nav a.active, .topbar-nav a:hover { color: var(--hih-ink); }
.topbar-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--hih-ink); transition: right 0.45s; }
.topbar-nav a:hover::after, .topbar-nav a.active::after { right: 0; }
.topbar-ctas { display: flex; gap: 0.6rem; align-items: center; }
.top-cta { border-radius: var(--hih-radius-btn); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; padding: 0.7rem 1.2rem; border: 1px solid var(--hih-rule); color: var(--hih-ink); transition: all 0.45s; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.top-cta:hover { background: var(--hih-ink); color: var(--hih-cream); border-color: var(--hih-ink); }
.top-cta-solid { background: var(--hih-btn); color: var(--hih-btn-ink); border-color: var(--hih-btn-edge); }
.top-cta-solid:hover { background: var(--hih-btn-hover); border-color: var(--hih-btn-edge); color: var(--hih-btn-ink); }
.nav-toggle { border-radius: var(--hih-radius-btn); display: none; background: transparent; border: 1px solid var(--hih-rule); color: var(--hih-ink); width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .icon-close { display: none; }
body.nav-open .nav-toggle .icon-open { display: none; }
body.nav-open .nav-toggle .icon-close { display: block; }
@media (max-width: 980px) { .topbar-nav, .topbar-ctas .top-cta { display: none; } .nav-toggle { display: inline-flex; } .topbar-ctas { justify-self: end; justify-content: flex-end; } }

/* ── drawer ── */
.drawer { position: fixed; inset: 0; z-index: 100; background: oklch(0.18 0.012 50); color: var(--hih-cream); padding: 1.5rem var(--hih-shell-pad); transform: translateY(-110%); transition: transform 0.55s cubic-bezier(0.83, 0, 0.17, 1); display: flex; flex-direction: column; pointer-events: none; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
body.nav-open .drawer { transform: translateY(0); pointer-events: auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3rem; }
.drawer ul { list-style: none; display: flex; flex-direction: column; gap: 1.4rem; }
.drawer ul a { font-family: var(--hih-sans); font-size: clamp(1.4rem, 4.5vw, 2.2rem); font-weight: 300; letter-spacing: 0.01em; line-height: 1.1; color: var(--hih-cream); }
.drawer-foot { margin-top: auto; display: flex; gap: 0.6rem; }
.drawer .top-cta { color: var(--hih-cream); border-color: oklch(1 0 0 / 0.3); }
.drawer .top-cta:hover { background: var(--hih-cream); color: var(--hih-ink); border-color: var(--hih-cream); }

/* ── footer ── */
.foot {
  padding: 2.5rem var(--hih-shell-pad);
  background: var(--hih-ink);
  color: var(--hih-cream);
  text-align: center;
  font-family: var(--hih-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  position: relative;
  z-index: 10;
}
.foot a {
  color: rgba(255,255,255,0.74);
  border-bottom: 1px solid oklch(0.92 0.05 75 / 0.4);
  transition: border-color 0.3s;
}
.foot a:hover { border-color: var(--hih-terra-soft); }

/* ── dropdowns ── */
.topbar-nav .has-dropdown { position: relative; }
.topbar-nav .has-dropdown > a > .caret { display: inline-block; width: 0; height: 0; margin-left: 0.4rem; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid currentColor; opacity: 0.7; vertical-align: middle; transition: transform 0.25s; }
.topbar-nav .has-dropdown:hover > a > .caret, .topbar-nav .has-dropdown:focus-within > a > .caret { transform: rotate(180deg); }
.topbar-nav .dropdown { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(-4px); width: max-content; padding: 1rem 1.1rem 0.9rem; background: oklch(1 0 0 / 0.98); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border: 1px solid var(--hih-rule); box-shadow: 0 18px 42px -18px oklch(0 0 0 / 0.22); list-style: none; display: flex; flex-direction: column; gap: 0.85rem; opacity: 0; visibility: hidden; transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s 0.22s; z-index: 200; }
.topbar-nav .has-dropdown:hover > .dropdown, .topbar-nav .has-dropdown:focus-within > .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); transition: opacity 0.22s ease, transform 0.22s ease; }
.topbar-nav .dropdown a { display: block; padding: 0.15rem 0; font-size: 13px; font-weight: 400; color: var(--hih-ink-mute); letter-spacing: 0.02em; white-space: nowrap; text-align: center; cursor: pointer; transition: color 0.25s; }
.topbar-nav .dropdown a::after { display: none; }
.topbar-nav .dropdown a:hover { color: var(--hih-ink); }
.topbar-nav .dropdown .has-dropdown { position: relative; }
.topbar-nav .dropdown .dropdown { position: absolute; top: 0; left: 100%; transform: translateX(-4px); min-width: 240px; padding: 0.9rem 1.1rem; margin-left: -1px; background: oklch(1 0 0 / 0.98); border: 1px solid var(--hih-rule); list-style: none; display: flex; flex-direction: column; gap: 0.25rem; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s 0.22s; }
.topbar-nav .dropdown .has-dropdown:hover > .dropdown, .topbar-nav .dropdown .has-dropdown:focus-within > .dropdown { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); }
.topbar-nav .dropdown .dropdown a { font-size: 13px; font-weight: 400; color: var(--hih-ink-mute); padding: 0.1rem 0; text-align: left; }
.topbar-nav .dropdown .symptoms-mega { gap: 0.25rem; }
.topbar-nav .dropdown .sym-cat { font-family: var(--hih-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--hih-ink-faint); padding: 0.55rem 0 0.15rem; border-bottom: 1px solid var(--hih-rule); margin-bottom: 0.1rem; }
.topbar-nav .dropdown .symptoms-mega > .sym-cat:first-child { padding-top: 0; }
.topbar-nav .dropdown .has-dropdown > a > .caret { margin-left: 0.4em; vertical-align: middle; }

/* ── drawer submenus ── */
.drawer .has-dropdown > .expand-btn { background: none; border: none; color: inherit; font: inherit; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 0.6em; font-family: var(--hih-sans); font-size: clamp(1.4rem, 4.5vw, 2.2rem); font-weight: 300; }
.drawer .has-dropdown > .expand-btn .caret { display: inline-block; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 7px solid currentColor; opacity: 0.7; transition: transform 0.3s ease; }
.drawer .has-dropdown.is-open > .expand-btn .caret { transform: rotate(180deg); }
.drawer .has-dropdown > ul { list-style: none; max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); margin-top: 0.4rem; padding-left: 1.2rem; border-left: 1px solid oklch(1 0 0 / 0.18); display: flex; flex-direction: column; gap: 0.85rem; }
.drawer .has-dropdown.is-open > ul { max-height: 80vh; overflow-y: auto; }
.drawer .has-dropdown > ul a { font-size: clamp(1rem, 3.5vw, 1.35rem); line-height: 1.25; color: oklch(1 0 0 / 0.85); font-family: var(--hih-sans); }
.drawer .has-dropdown > ul .has-dropdown > .expand-btn { font-size: clamp(1rem, 3.5vw, 1.35rem); font-weight: 300; line-height: 1.25; color: oklch(1 0 0 / 0.85); }
.drawer .has-dropdown > ul .has-dropdown > ul { padding-left: 1rem; }
.drawer .has-dropdown > ul .has-dropdown > ul a { font-size: clamp(0.9rem, 3vw, 1.1rem); color: oklch(1 0 0 / 0.7); }
.drawer .symptoms-mega .sym-cat { display: block; font-family: var(--hih-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: oklch(1 0 0 / 0.45); padding: 0.6rem 0 0.2rem; border-bottom: 1px solid oklch(1 0 0 / 0.15); margin-bottom: 0.1rem; }
.drawer .symptoms-mega > .sym-cat:first-child { padding-top: 0; }

/* the shell is always visible on these pages — no hide-on-scroll — so anything
   the page sticks to the top has somewhere predictable to sit. */
.topbar { top: 0; }
