/* =========================================================================
 * Hashbox V2 — Phase 3 Navigation Components
 * Depends on: tokens.css
 *
 * Components:
 *   15. Sticky Nav (.hb-nav, .hb-nav--glass on scroll)
 *   16. Mobile Sheet (.hb-sheet, .hb-sheet--open)
 *   17. Breadcrumb (.hb-breadcrumb)
 *   18. Footer (.hb-footer)
 * ========================================================================= */

/* -------------------------------------------------------------------------
 * 15. STICKY NAV
 * ----------------------------------------------------------------------- */

.hb-nav {
  position: fixed;
  top: var(--hb-space-3);
  left: var(--hb-space-3);
  right: var(--hb-space-3);
  z-index: var(--hb-z-sticky);
  height: 3.5rem;
  background: var(--hb-glass-1);
  backdrop-filter: blur(var(--hb-glass-blur));
  -webkit-backdrop-filter: blur(var(--hb-glass-blur));
  border: 1px solid oklch(100% 0 0 / 0.08);
  border-radius: var(--hb-radius-full);
  box-shadow: var(--hb-shadow-md);
  transition: top var(--hb-duration-normal) var(--hb-ease-out),
              left var(--hb-duration-normal) var(--hb-ease-out),
              right var(--hb-duration-normal) var(--hb-ease-out),
              border-radius var(--hb-duration-normal) var(--hb-ease-out);
}

.hb-nav--scrolled {
  top: 0;
  left: 0;
  right: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.hb-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hb-space-6);
  height: 100%;
  padding: 0 var(--hb-space-5);
  max-width: var(--hb-container-xl);
  margin-inline: auto;
}

.hb-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-2);
  font-family: var(--hb-font-display);
  font-size: var(--hb-text-base);
  font-weight: var(--hb-weight-bold);
  letter-spacing: var(--hb-tracking-tight);
  color: var(--hb-text-strong);
  text-decoration: none;
}

.hb-nav__brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--hb-radius-xs);
  background: var(--hb-grad-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hb-text-strong);
  font-weight: var(--hb-weight-black);
  font-size: 0.75rem;
}

.hb-nav__brand-accent {
  color: var(--hb-accent-cyan);
  font-weight: var(--hb-weight-medium);
}

.hb-nav__menu {
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.hb-nav__menu li { display: inline-flex; }

.hb-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-1);
  font-size: var(--hb-text-sm);
  font-weight: var(--hb-weight-medium);
  color: var(--hb-text);
  text-decoration: none;
  padding: var(--hb-space-2) var(--hb-space-3);
  border-radius: var(--hb-radius-sm);
  transition: color var(--hb-duration-fast) var(--hb-ease-out),
              background var(--hb-duration-fast) var(--hb-ease-out);
}

.hb-nav__link:hover {
  color: var(--hb-text-strong);
  background: oklch(100% 0 0 / 0.05);
}

.hb-nav__link[aria-current="page"] {
  color: var(--hb-text-strong);
}
.hb-nav__link[aria-current="page"]::after {
  content: '';
  width: 4px; height: 4px;
  margin-left: var(--hb-space-1);
  background: var(--hb-accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--hb-accent-blue);
}

.hb-nav__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-2);
}

/* Build status indicator (Linear-style) */
.hb-nav__status {
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-2);
  padding: var(--hb-space-1) var(--hb-space-3);
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-xs);
  color: var(--hb-text-muted);
  border-radius: var(--hb-radius-full);
}
.hb-nav__status::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--hb-accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--hb-accent-emerald);
  animation: hb-pulse 2s ease-in-out infinite;
}
@keyframes hb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Mobile hamburger */
.hb-nav__burger {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-sm);
  cursor: pointer;
  color: var(--hb-text-strong);
}
.hb-nav__burger:hover { background: var(--hb-surface-1); }

@media (max-width: 768px) {
  .hb-nav__menu { display: none; }
  .hb-nav__burger { display: inline-flex; }
  .hb-nav__status { display: none; }
}

/* -------------------------------------------------------------------------
 * 16. MOBILE SHEET (drawer for mobile nav)
 * ----------------------------------------------------------------------- */

.hb-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--hb-z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hb-duration-normal) var(--hb-ease-out);
}

.hb-sheet-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.hb-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(20rem, 90vw);
  z-index: calc(var(--hb-z-modal) + 1);
  background: var(--hb-surface-1);
  border-left: 1px solid var(--hb-border);
  box-shadow: var(--hb-shadow-xl);
  transform: translateX(100%);
  transition: transform var(--hb-duration-normal) var(--hb-ease-out-expo);
  display: flex;
  flex-direction: column;
  padding: var(--hb-space-5);
  gap: var(--hb-space-4);
}

.hb-sheet[data-open="true"] {
  transform: translateX(0);
}

.hb-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--hb-space-2);
}

.hb-sheet__close {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-sm);
  cursor: pointer;
  color: var(--hb-text);
}
.hb-sheet__close:hover { background: var(--hb-surface-2); color: var(--hb-text-strong); }

.hb-sheet__menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-1);
}

.hb-sheet__link {
  display: flex;
  align-items: center;
  gap: var(--hb-space-3);
  padding: var(--hb-space-3) var(--hb-space-4);
  font-size: var(--hb-text-base);
  font-weight: var(--hb-weight-medium);
  color: var(--hb-text);
  text-decoration: none;
  border-radius: var(--hb-radius-sm);
}
.hb-sheet__link:hover {
  background: var(--hb-surface-2);
  color: var(--hb-text-strong);
}

.hb-sheet__footer {
  margin-top: auto;
  padding-top: var(--hb-space-4);
  border-top: 1px solid var(--hb-border);
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-2);
}

/* -------------------------------------------------------------------------
 * 17. BREADCRUMB
 * ----------------------------------------------------------------------- */

.hb-breadcrumb {
  padding: var(--hb-space-3) 0;
  font-size: var(--hb-text-sm);
}

.hb-breadcrumb__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--hb-space-2);
  color: var(--hb-text-muted);
}

.hb-breadcrumb__list li { display: inline-flex; align-items: center; gap: var(--hb-space-2); }

.hb-breadcrumb__sep {
  color: var(--hb-text-faint);
  font-size: 0.875em;
}

.hb-breadcrumb a {
  color: var(--hb-text-muted);
  text-decoration: none;
  transition: color var(--hb-duration-fast);
}
.hb-breadcrumb a:hover { color: var(--hb-text-strong); }

.hb-breadcrumb [aria-current="page"] {
  color: var(--hb-text-strong);
  font-weight: var(--hb-weight-medium);
}

/* -------------------------------------------------------------------------
 * 18. FOOTER
 * ----------------------------------------------------------------------- */

.hb-footer {
  background: var(--hb-bg);
  border-top: 1px solid var(--hb-border);
  padding-block: var(--hb-space-16) var(--hb-space-8);
  margin-top: var(--hb-space-24);
  position: relative;
}

.hb-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hb-accent-blue), var(--hb-accent-violet), var(--hb-accent-cyan), transparent);
  opacity: 0.4;
}

.hb-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--hb-space-12) var(--hb-space-8);
}

@media (max-width: 1024px) {
  .hb-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .hb-footer__grid { grid-template-columns: 1fr; }
}

.hb-footer__col h3 {
  font-family: var(--hb-font-mono);
  font-size: var(--hb-text-xs);
  font-weight: var(--hb-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--hb-tracking-wider);
  color: var(--hb-text-faint);
  margin: 0 0 var(--hb-space-4);
}

.hb-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-3);
}

.hb-footer__col a {
  color: var(--hb-text);
  text-decoration: none;
  font-size: var(--hb-text-sm);
  transition: color var(--hb-duration-fast);
}
.hb-footer__col a:hover { color: var(--hb-text-strong); }

.hb-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--hb-space-4);
}

.hb-footer__brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--hb-space-2);
  font-family: var(--hb-font-display);
  font-weight: var(--hb-weight-bold);
  color: var(--hb-text-strong);
  text-decoration: none;
}

.hb-footer__desc {
  font-size: var(--hb-text-sm);
  color: var(--hb-text-muted);
  line-height: var(--hb-leading-relaxed);
  max-width: 32ch;
}

.hb-footer__socials {
  display: flex;
  gap: var(--hb-space-2);
  margin-top: var(--hb-space-2);
}

.hb-footer__social {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hb-surface-1);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-sm);
  color: var(--hb-text-muted);
  font-family: var(--hb-font-mono);
  font-size: 11px;
  font-weight: var(--hb-weight-medium);
  text-decoration: none;
  transition: all var(--hb-duration-fast);
}
.hb-footer__social:hover {
  background: var(--hb-surface-2);
  border-color: var(--hb-border-strong);
  color: var(--hb-text-strong);
}

.hb-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hb-space-4);
  padding-top: var(--hb-space-8);
  margin-top: var(--hb-space-12);
  border-top: 1px solid var(--hb-border);
  font-size: var(--hb-text-xs);
  color: var(--hb-text-faint);
  flex-wrap: wrap;
}

.hb-footer__legal {
  display: flex;
  gap: var(--hb-space-5);
  flex-wrap: wrap;
}

.hb-footer__legal a {
  color: var(--hb-text-faint);
  text-decoration: none;
  font-size: var(--hb-text-xs);
}
.hb-footer__legal a:hover { color: var(--hb-text); }
