/* Chiral Audio — shared site chrome (nav + footer) for non-home pages.
 *
 * The home page (index.html) defines its own copies of these rules inline
 * because it Reactifies the navbar (brand IntersectionObserver, drawer
 * toggle). This stylesheet ports the same visual behaviour to standalone
 * pages so the floating glass pill is consistent across the site and
 * gets a more solid treatment once the user scrolls past the hero.
 *
 * Assumes the host page already defines the design tokens
 * (--bg, --foreground, --stroke, --accent-signal-deep, --font-display,
 * --font-heading, --font-mono). The block below adds the few that older
 * pages don't have.
 */

:root {
  /* Dark-tinted glass so the pill reads on light page sections too. */
  --glass-bg: rgba(10, 18, 20, 0.32);
  --glass-border-start: rgba(255, 255, 255, 0.45);
  --glass-border-fade: rgba(255, 255, 255, 0.08);
}

/* ============================================================
 * Liquid-glass primitives — shared between nav and CTAs.
 * ============================================================ */
.liquid-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  background: linear-gradient(
    180deg,
    var(--glass-border-start) 0%,
    var(--glass-border-fade) 20%,
    transparent 40%,
    transparent 60%,
    var(--glass-border-fade) 80%,
    var(--glass-border-start) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.liquid-glass-strong {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(48px);
  -webkit-backdrop-filter: blur(48px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 10px 40px -20px rgba(0, 200, 255, 0.25);
  position: relative;
  overflow: hidden;
  transition: box-shadow 260ms ease, transform 260ms ease;
}
.liquid-glass-strong::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.12) 20%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.12) 80%,
    rgba(255, 255, 255, 0.55) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.liquid-glass-strong:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 14px 50px -16px rgba(72, 205, 255, 0.55),
    0 0 28px rgba(72, 205, 255, 0.22);
  transform: scale(1.02);
}

/* ============================================================
 * Nav wrap — floating pill positioning + scroll-responsive theme.
 * ============================================================ */
.nav-wrap {
  /* Per-page accent (RGB triplets so we can compose alpha via rgb(... / α)).
   * Default = teal-on-dark for foxfire / dark pages. Standalone pages with
   * lighter section backgrounds (autocat, soliton) override these locally so
   * the cart badge circle matches the pill stroke and the digit reads as a
   * knockout in the page's own deep tone. */
  --nav-accent: 61 215 179;          /* circle fill + active pill stroke */
  --nav-accent-ink: 8 16 18;         /* digit colour (page deep tone) */
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 20px 16px 0;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.nav-wrap > * { pointer-events: auto; }

.navbar {
  display: inline-flex;
  align-items: center;
  padding: 8px;
  border-radius: 999px;
  font-family: var(--font-heading);
  gap: 2px;
  /* Override .liquid-glass's overflow:hidden so dropdown menus
     anchored inside the pill (e.g. catalog-menu) aren't clipped. */
  overflow: visible;
  transition:
    background 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-wrap.nav-scrolled .navbar {
  /* Hardcoded dark fill so the pill reads against any section background
     (warm-paper on autocatalysis, aqua-paper on soliton, dark on foxfire).
     Avoids token roulette across pages that mix hex and HSL variables. */
  background: rgba(8, 16, 18, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 14px 40px -22px rgba(0, 0, 0, 0.55);
}
.nav-wrap.nav-scrolled .navbar::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 30%,
    transparent 45%,
    transparent 55%,
    rgba(255, 255, 255, 0.06) 70%,
    rgba(255, 255, 255, 0.22) 100%
  );
}

.nav-divider-line {
  width: 100%;
  margin-top: 14px;
  /* Slightly higher opacity than the homepage (was 0.06) so the line is
     visible on warm-earth and aqua backgrounds as well as dark teal. */
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  transition: opacity 280ms ease;
}
.nav-wrap.nav-scrolled .nav-divider-line { opacity: 0; }

.nav-divider {
  width: 1px;
  height: 20px;
  background: #14463E;
  background: hsl(var(--stroke));
  margin: 0 6px;
}

/* ============================================================
 * Brand mark — 3-state image inside the pill, left-aligned.
 * Hidden by default to match the homepage's initial-pill size;
 * appears with an animation once .nav-scrolled is set (i.e. once
 * the user has scrolled past the hero threshold). Pages that want
 * the brand always-on can set body[data-show-brand] to override.
 * ============================================================ */
.nav-brand {
  position: relative;
  display: none;
  width: 36px;
  height: 36px;
  margin: 0 6px 0 2px;
  line-height: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.nav-brand + .nav-divider { display: none; }
.nav-wrap.nav-scrolled .nav-brand,
body[data-show-brand] .nav-brand {
  display: inline-block;
  animation: nav-brand-in 320ms cubic-bezier(.22, .61, .36, 1) forwards;
}
.nav-wrap.nav-scrolled .nav-brand + .nav-divider,
body[data-show-brand] .nav-brand + .nav-divider {
  display: inline-block;
}
/* Once the circle-mark brand is visible in the pill, "Home" becomes
 * redundant — the brand IS the home link. Hide the text version. */
.nav-wrap.nav-scrolled .nav-link--home,
body[data-show-brand] .nav-link--home {
  display: none;
}
@keyframes nav-brand-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
.nav-brand > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 180ms cubic-bezier(.22, .61, .36, 1);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  border-radius: 50%;
}
.nav-brand .state-neutral { opacity: 1; }
.nav-brand:hover .state-neutral { opacity: 0; }
.nav-brand:hover .state-hover { opacity: 1; }
.nav-brand:active .state-hover { opacity: 0; }
.nav-brand:active .state-click { opacity: 1; }
.nav-brand:focus-visible {
  outline: 2px solid hsl(var(--accent-signal-light, var(--accent-signal-deep)));
  outline-offset: 2px;
  border-radius: 50%;
}

/* ============================================================
 * Nav links + CTAs.
 * ============================================================ */
.nav-link, .nav-cta {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  /* Hardcoded near-white for legibility on any pill background — ~90%
     ink works across the dark-tinted glass and the scrolled-state pill. */
  color: rgba(244, 250, 250, 0.92);
  transition: background 200ms ease, color 200ms ease;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.nav-link:hover {
  color: #E8F0F0;
  color: hsl(var(--foreground));
  background: rgba(20, 70, 62, 0.6);
  background: hsl(var(--stroke) / 0.6);
}
.nav-link.is-active {
  color: #E8F0F0;
  color: hsl(var(--foreground));
  background: rgba(20, 70, 62, 0.8);
  background: hsl(var(--stroke) / 0.8);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #F4FAFA;
  margin-left: 4px;
  text-decoration: none;
}
.nav-cta svg { width: 14px; height: 14px; opacity: 0.85; }

/* The .navbar override above sets overflow: visible so the catalog
 * dropdown can extend below. That also lets the .liquid-glass-strong
 * box-shadow glow on the Sign-up CTA spill outside the pill. Inside the
 * navbar context, suppress the persistent glow and reserve it for hover.
 * Visually matches the homepage where the glow is always present but
 * clipped by .navbar's overflow: hidden. */
.navbar .nav-cta.liquid-glass-strong {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transform: none;
}
.navbar .nav-cta.liquid-glass-strong:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 8px 24px -10px rgba(72, 205, 255, 0.35);
  transform: none;
}

/* ============================================================
 * Cart pill — empty state is icon-only; with items expands to
 * icon + label + count.
 * ============================================================ */
.nav-cart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(244, 250, 250, 0.85);
  border: 1px solid rgba(244, 250, 250, 0.18);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition:
    padding 220ms cubic-bezier(.22, .61, .36, 1),
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    gap 220ms cubic-bezier(.22, .61, .36, 1);
}
.nav-cart.is-empty { padding: 7px; }
.nav-cart.is-active {
  padding: 7px 13px;
  background: rgb(var(--nav-accent) / 0.08);
  border-color: rgb(var(--nav-accent) / 0.55);
  color: #F4FAFA;
}
.nav-cart:hover {
  color: #E8F0F0;
  color: hsl(var(--foreground));
  background: rgba(232, 240, 240, 0.04);
  background: hsl(var(--foreground) / 0.04);
  border-color: rgba(232, 240, 240, 0.28);
  border-color: hsl(var(--foreground) / 0.28);
}
.nav-cart svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-cart-label[hidden],
.nav-cart-count[hidden] { display: none; }
.nav-cart-count {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  background: rgb(var(--nav-accent));
  color: rgb(var(--nav-accent-ink));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* ============================================================
 * Mobile responsiveness.
 * ============================================================ */
@media (max-width: 720px) {
  .nav-wrap { padding: 12px 12px 0; }
  .navbar { padding: 6px; gap: 0; }
  .nav-link { padding: 7px 10px; font-size: 12px; }
  .nav-cta { padding: 7px 11px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  .nav-cta svg { width: 11px; height: 11px; }
  .nav-cart { font-size: 12px; flex-shrink: 0; }
  .nav-cart svg { width: 16px; height: 16px; }
  .nav-cart-label { display: none; }
  .nav-link--home { display: none; }
  .nav-divider { margin: 0 2px; }
}

/* ============================================================
 * Footer — mirrors React SiteFooterV2.
 * ============================================================ */
.nl-footer {
  background: #030608;
  padding: 34px clamp(1.5rem, 4vw, 3rem) 38px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: hsl(var(--foreground) / 0.4);
  margin-top: 56px;
}
.nl-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}
.nl-footer-brand {
  display: grid;
  gap: 7px;
  max-width: 360px;
  line-height: 1.5;
}
.nl-footer-brand strong {
  color: hsl(var(--foreground) / 0.78);
  font-weight: 500;
}
.nl-footer-brand span {
  color: hsl(var(--foreground) / 0.38);
  letter-spacing: 0.04em;
}
.nl-footer-nav {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 18px 38px;
  justify-content: end;
}
.nl-footer-group {
  display: grid;
  gap: 8px;
  align-content: start;
}
.nl-footer-group > span {
  color: hsl(var(--foreground) / 0.28);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nl-footer-nav a {
  color: hsl(var(--foreground) / 0.55);
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}
.nl-footer-nav a:hover { color: hsl(var(--foreground)); }
@media (max-width: 720px) {
  .nl-footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .nl-footer-nav { grid-template-columns: 1fr; justify-items: center; gap: 18px; }
  .nl-footer-group { justify-items: center; }
}

/* ============================================================
 * Page padding-top reservation — without this, the fixed nav
 * overlaps the start of the document. Pages with a hero already
 * absorb this; legal/cart pages get the explicit padding.
 * ============================================================ */
body[data-nav-pad] { padding-top: 84px; }
