/* ==========================================================================
   Site chrome: floating header + footer.
   Header follows the theme tokens (light/dark). The footer is always dark
   so the full-colour logo stays legible in both modes.
   Brand colours from the logo: gold #e8a33b (= --lime accent), teal #2aa7b0.
   ========================================================================== */

:root { --toc-teal: #2aa7b0; --toc-edge: clamp(12px, 2.4vw, 32px); }

/* ---------- Header ---------- */
#topnav.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: block; height: auto; padding: 12px var(--toc-edge) 0;
  background: none !important; border: 0 !important; box-shadow: none !important;
  backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none;
}
#topnav .nav__bar {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: clamp(12px, 2vw, 28px);
  max-width: 1480px; height: 64px; margin: 0 auto; padding: 0 10px 0 14px;
  border-radius: 16px;
  background: rgba(9, 13, 11, .55);
  background: color-mix(in srgb, var(--ink) 58%, transparent);
  border: 1px solid rgba(237, 244, 239, .09);
  border-color: color-mix(in srgb, var(--sky) 10%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  transition: height .35s cubic-bezier(.16, 1, .3, 1), background .3s ease, box-shadow .3s ease, border-color .3s ease;
}
/* Light mode: a more solid bar so it stays crisp over the dark home hero. */
:root:not([data-theme="dark"]) #topnav .nav__bar { background: rgba(247, 244, 236, .9); background: color-mix(in srgb, var(--ink) 90%, transparent); }
#topnav.scrolled .nav__bar {
  height: 58px;
  background: rgba(9, 13, 11, .9);
  background: color-mix(in srgb, var(--ink) 90%, transparent);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .22);
}

/* Brand: monogram + wordmark */
#topnav .nav__brand { display: flex; align-items: center; gap: 12px; flex: none; min-width: 0; color: var(--sky); text-decoration: none; }
#topnav .nav__mark { display: block; flex: none; }
#topnav .nav__mark img { display: block; width: auto; height: 40px; transition: height .35s cubic-bezier(.16, 1, .3, 1); }
#topnav.scrolled .nav__mark img { height: 36px; }
#topnav .nav__wordmark {
  font-family: 'Inter', system-ui, sans-serif; font-size: 13px; font-weight: 600; line-height: 1;
  letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; color: var(--sky);
}
#topnav .nav__brand:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; border-radius: 8px; }

/* Links */
#topnav .nav__right { display: flex; align-items: center; gap: clamp(8px, 1vw, 14px); min-width: 0; }
#topnav .nav__links { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; flex-wrap: nowrap; }
#topnav .nav__links > li > a {
  display: block; padding: 9px clamp(9px, .9vw, 14px); border-radius: 999px;
  font-size: clamp(11px, .82vw, 12.5px); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--sky); opacity: .78; transition: opacity .2s ease, background .2s ease, color .2s ease;
}
#topnav .nav__links > li > a::after { display: none; }
#topnav .nav__links > li > a:hover { opacity: 1; background: rgba(237, 244, 239, .07); background: color-mix(in srgb, var(--sky) 8%, transparent); }
#topnav .nav__links > li > a:focus-visible { opacity: 1; outline: 2px solid var(--lime); outline-offset: 1px; }
#topnav .nav__links > .current-menu-item > a,
#topnav .nav__links > .current-menu-ancestor > a,
#topnav .nav__links a[aria-current="page"] {
  opacity: 1; color: var(--sky);
  background: rgba(232, 163, 59, .14); background: color-mix(in srgb, var(--lime) 15%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 35%, transparent);
}

/* CTA pill + theme toggle.
   Pill = label + round arrow icon (same pattern as the Optimize Health Clinic "Order Now" button).
   Dark theme: gold pill, dark icon. Light theme: dark pill, gold icon. */
#topnav .pill {
  flex: none; white-space: nowrap; padding: 5px 5px 5px 16px; gap: 10px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .12em; line-height: 1;
  background: var(--lime); border: 0; color: #111;
  box-shadow: 0 0 0 4px rgba(232, 163, 59, .14);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
#topnav .pill__label { display: block; }
#topnav .pill__icon {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: #111; color: var(--lime); transition: transform .25s ease;
}
#topnav .pill__icon svg { display: block; }
#topnav .pill:hover, #topnav .pill:focus-visible { color: #111; background: var(--lime); box-shadow: 0 0 0 5px rgba(232, 163, 59, .22), 0 10px 26px rgba(232, 163, 59, .28); }
#topnav .pill:hover .pill__icon, #topnav .pill:focus-visible .pill__icon { transform: translateX(2px); }
#topnav .pill:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
#topnav .pill[aria-current="page"] { box-shadow: 0 0 0 4px rgba(232, 163, 59, .32); }
:root:not([data-theme="dark"]) #topnav .pill,
:root:not([data-theme="dark"]) #topnav .pill:hover,
:root:not([data-theme="dark"]) #topnav .pill:focus-visible { background: #101a16; color: #fff; }
:root:not([data-theme="dark"]) #topnav .pill__icon { background: var(--lime); color: #fff; }
/* Mobile menu copy of the button (cloned by script.js). */
.mobile-menu__cta .pill { gap: 12px; padding: 6px 6px 6px 20px; border: 0; }
.mobile-menu__cta .pill__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: #111; }
#topnav .theme-toggle { flex: none; }

/* Small laptops: one link moves out (still in the mobile menu and footer). */
@media (min-width: 1024px) and (max-width: 1279px) {
  #topnav .nav__links .menu-item--secondary { display: none; }
}
@media (min-width: 1121px) and (max-width: 1180px) {
  #topnav .nav__wordmark { font-size: 12px; letter-spacing: .16em; }
}
/* Narrowest laptops: the monogram alone carries the brand. */
@media (min-width: 1024px) and (max-width: 1120px) {
  #topnav .nav__wordmark { display: none; }
}

/* Tablet & phone: brand, "Explore your Genetics" button, theme toggle, menu button. */
@media (max-width: 1023px) {
  #topnav.nav { padding: 10px 12px 0; height: auto !important; }
  #topnav .nav__bar { height: 58px; padding: 0 8px 0 12px; border-radius: 14px; gap: 10px; }
  #topnav .nav__mark img { height: 34px; }
  #topnav .nav__wordmark { font-size: 11.5px; letter-spacing: .16em; }
  #topnav .nav__right { gap: 8px; }
  /* The older responsive stylesheet hid this button below 1024px; keep it visible. */
  #topnav .nav__right > .pill { display: inline-flex !important; padding: 5px 5px 5px 14px; gap: 9px; font-size: 11px; letter-spacing: .1em; }
  #topnav .nav__toggle, #topnav .theme-toggle { border-radius: 12px !important; }
}
/* Phones: the monogram alone carries the brand so the button keeps its full label. */
@media (max-width: 600px) {
  #topnav .nav__wordmark { display: none; }
  #topnav .nav__mark img { height: 32px; }
  #topnav .nav__right { gap: 6px; }
  #topnav .nav__right > .pill { padding: 4px 4px 4px 12px; gap: 8px; font-size: 10px; letter-spacing: .07em; }
  #topnav .pill__icon { width: 26px; height: 26px; }
  /* An uploaded wide logo must leave room for the button. */
  #topnav .nav__brand-logo { max-width: 112px; height: 30px; }
}
@media (max-width: 400px) {
  #topnav .nav__bar { padding: 0 6px 0 10px; gap: 6px; }
  #topnav .nav__mark img { height: 28px; }
  #topnav .nav__right > .pill { padding: 4px 4px 4px 10px; gap: 6px; font-size: 9.5px; letter-spacing: .04em; }
  #topnav .pill__icon { width: 24px; height: 24px; }
  #topnav .theme-toggle, #topnav .nav__toggle { width: 34px !important; height: 34px !important; min-width: 34px !important; }
}
@media (max-width: 359px) {
  #topnav .nav__right > .pill { gap: 5px; padding-left: 9px; font-size: 9px; letter-spacing: .03em; }
  #topnav .pill__icon { width: 22px; height: 22px; }
  #topnav .pill__icon svg { width: 12px; height: 12px; }
}
/* Very small phones: the light/dark switch steps aside so the button fits. */
@media (max-width: 349px) {
  #topnav .theme-toggle { display: none !important; }
}

/* ---------- Footer ---------- */
.site-footer {
  --f-bg: #060908; --f-surface: #0d1310; --f-text: #edf4ef; --f-muted: #9fada6; --f-line: rgba(237, 244, 239, .1);
  --f-gold: #e8a33b; --f-teal: var(--toc-teal);
  position: relative; overflow: hidden; isolation: isolate;
  padding: 0 clamp(20px, 3.5vw, 60px);
  background: var(--f-bg); color: var(--f-text);
  color-scheme: dark;
}
.site-footer::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, var(--f-gold) 30%, var(--f-teal) 70%, transparent);
  opacity: .7;
}
.site-footer::after {
  content: ""; position: absolute; z-index: -1; left: 50%; top: -260px; width: 900px; height: 520px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(42, 167, 176, .12), transparent);
  pointer-events: none;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:focus-visible, .site-footer button:focus-visible { outline: 2px solid var(--f-gold); outline-offset: 3px; border-radius: 4px; }

.site-footer__main {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 64px);
  max-width: 1480px; margin: 0 auto; padding-block: clamp(48px, 6vw, 80px);
}
/* The logo is a centred (stacked) emblem, so the brand block is centred on its axis:
   logo, description and social icons share one centre line. */
.site-footer__brand { display: grid; gap: 18px; align-content: start; justify-items: center; text-align: center; max-width: 340px; }
.site-footer__logo { display: block; line-height: 0; }
.site-footer__logo img { display: block; width: clamp(170px, 15vw, 210px); height: auto; margin-top: -6px; }
.site-footer__desc { margin: 0; max-width: 36ch; color: var(--f-muted); font-size: 14.5px; line-height: 1.7; }
.site-footer__social { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 2px 0 0; padding: 0; list-style: none; }
.site-footer__social a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--f-line); color: var(--f-text);
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.site-footer__social a:hover { border-color: var(--f-gold); color: var(--f-gold); transform: translateY(-2px); }

.site-footer__heading { margin: 0 0 18px; font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--f-muted); }
.site-footer .footer-menu { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.site-footer .footer-menu a { font-size: 15px; color: var(--f-text); overflow-wrap: anywhere; transition: color .2s ease; }
.site-footer .footer-menu a:hover { color: var(--f-gold); }

.site-footer__bottom {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px;
  max-width: 1480px; margin: 0 auto; padding-block: 22px 28px;
  border-top: 1px solid var(--f-line); font-size: 12.5px; color: var(--f-muted);
}
.site-footer__legal { flex: 1; min-width: 220px; }
.site-footer .footer-legal-menu { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.site-footer__top {
  margin-left: auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--f-line);
  background: transparent; color: var(--f-text); font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
}
.site-footer__top:hover { border-color: var(--f-gold); color: var(--f-gold); }

.site-footer__watermark {
  position: absolute; z-index: -1; left: 50%; bottom: -0.18em; transform: translateX(-50%);
  font-family: 'Anton SC', 'Anton', sans-serif; font-size: clamp(120px, 22vw, 360px); line-height: 1; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(237, 244, 239, .06); pointer-events: none; user-select: none;
}

@media (max-width: 1023px) {
  .site-footer__main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; justify-self: center; padding-bottom: 28px; border-bottom: 1px solid var(--f-line); max-width: none; width: 100%; }
}
@media (max-width: 640px) {
  .site-footer__main { grid-template-columns: 1fr 1fr; }
  .site-footer__main > .site-footer__col:last-child { grid-column: 1 / -1; }
  .site-footer__top { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #topnav .nav__bar, #topnav .nav__mark img, #topnav .pill, #topnav .pill__icon, .site-footer__social a { transition: none; }
}
