/* NavBar — UI-Kit-faithful: status strip + clean primary row */

/* ----- Top status strip ----- */
.topstrip {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--rule);
  z-index: 101;
  font-family: var(--font-mono);
  animation: navDrop 600ms cubic-bezier(.2,.8,.2,1) both 100ms;
}
.topstrip__inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-2);
}
.topstrip__l { display: inline-flex; align-items: center; gap: 8px; }
.topstrip__dot { color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.topstrip__r { display: inline-flex; align-items: center; gap: 8px; }
.topstrip__sep { color: var(--fg-3); }
.topstrip a { color: var(--fg-2); text-decoration: none; transition: color 200ms; }
.topstrip a:hover { color: var(--accent); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ----- Main navbar ----- */
.navbar {
  position: fixed;
  top: 28px; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-0);
  border-bottom: 1px solid var(--rule);
  transition: background 220ms, border-color 220ms, top 220ms;
  animation: navDrop 700ms cubic-bezier(.2,.8,.2,1) both 200ms;
  font-family: var(--font-mono);
}
.navbar.is-scrolled {
  background: color-mix(in srgb, var(--bg-0) 92%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--rule-strong);
}
@keyframes navDrop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.navbar__inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}
.navbar__brand { justify-self: start; }
.navbar__actions { justify-self: end; }
.navbar.is-scrolled .navbar__inner { height: 56px; transition: height 220ms; }

.navbar__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg-0);
}
.navbar__brand-logo {
  height: 26px;
  width: auto;
  display: block;
  transition: opacity 220ms;
}
[data-theme="dark"]  .navbar__brand-logo--light { display: none; }
[data-theme="light"] .navbar__brand-logo--dark  { display: none; }
.navbar__brand:hover .navbar__brand-logo { opacity: 0.85; }

.navbar__nav {
  display: flex;
  justify-content: center;
  gap: 2px;
}
.nav-item { position: relative; }

.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-1);
  text-decoration: none;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  transition: color 200ms;
}
.nav-link::before {
  content: "";
  position: absolute;
  left: 14px; right: 14px;
  bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 280ms cubic-bezier(.2,.7,.2,1);
}
.nav-link:hover { color: var(--fg-0); }
.nav-link:hover::before,
.nav-link[data-open="true"]::before { transform: scaleX(1); }
.nav-link[data-open="true"] { color: var(--accent); }

.nav-caret {
  width: 9px; height: 6px;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.nav-link[data-open="true"] .nav-caret { transform: rotate(180deg); }

.nav-link--small { font-size: 11px; padding: 8px 10px; }

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.navbar__rule {
  width: 1px; height: 18px;
  background: var(--rule);
}
.btn--sm { height: 34px; padding: 0 14px; font-size: 11px; }

.hamburger {
  display: none;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 14px; height: 1.5px;
  background: var(--fg-0);
  transition: transform 240ms cubic-bezier(.2,.7,.2,1), opacity 240ms;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Dropdown card — fabric-card aesthetic, anchored to nav-item */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: -8px;
  width: 360px;
  background: var(--bg-1);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.45),
              0 8px 16px -8px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 200ms, transform 220ms cubic-bezier(.2,.7,.2,1);
  z-index: 110;
  font-family: var(--font-mono);
}
.dropdown.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* tick mark connecting to nav-link */
.dropdown::before {
  content: "";
  position: absolute;
  top: -1px; left: 24px;
  width: 24px; height: 1px;
  background: var(--accent);
}

/* head strip — mirrors fabric-card__head */
.dropdown__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
}
.dropdown__pip {
  width: 6px; height: 6px;
  background: var(--accent);
  display: inline-block;
  flex: 0 0 auto;
  animation: ddPip 1.6s ease-in-out infinite;
}
@keyframes ddPip { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.dropdown__eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  flex: 1;
}
.dropdown__count {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-3);
}

/* intro */
.dropdown__intro { padding: 14px 14px 12px; }
.dropdown__headline {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg-0);
  letter-spacing: -0.005em;
}
.dropdown__sub {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--fg-2);
}

/* ascii rule between intro and list */
.dropdown__rule {
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--rule) 0, var(--rule) 4px,
    transparent 4px, transparent 7px
  );
  margin: 0 14px;
}

/* list */
.dropdown__list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.dropdown__item {
  display: grid;
  grid-template-columns: 28px 1fr 14px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  position: relative;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 280ms, transform 280ms,
              background 180ms, padding-left 200ms;
}
.dropdown.is-open .dropdown__item {
  opacity: 1;
  transform: translateX(0);
  transition-delay: var(--ddi, 0ms);
}
.dropdown__item-k {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.14em;
  align-self: center;
}
.dropdown__item-text { min-width: 0; }
.dropdown__item-h {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-0);
  transition: color 180ms;
}
.dropdown__item-b {
  font-size: 11px;
  color: var(--fg-2);
  margin-top: 1px;
}
.dropdown__item-arrow {
  font-size: 12px;
  color: var(--fg-3);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms, transform 200ms cubic-bezier(.2,.7,.2,1), color 180ms;
}
.dropdown__item:hover {
  background: var(--accent-tint);
  padding-left: 18px;
}
.dropdown__item:hover .dropdown__item-h { color: var(--accent); }
.dropdown__item:hover .dropdown__item-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

/* foot — status strip */
.dropdown__foot {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  text-transform: lowercase;
  background: var(--bg-2);
}
.dropdown__foot kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-3);
  border: 1px solid var(--rule-strong);
  padding: 0 5px;
  margin-left: 3px;
  color: var(--fg-1);
}

/* Mobile overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 260ms, transform 260ms;
  padding-top: 100px;
  overflow-y: auto;
}
.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.mobile-menu__inner {
  padding: 24px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.mobile-menu__group { display: flex; flex-direction: column; }
.mobile-menu__h {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.mobile-menu__item {
  display: block;
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-0);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 200ms, padding-left 200ms;
}
.mobile-menu__item:hover { color: var(--accent); padding-left: 6px; }

@media (max-width: 980px) {
  .topstrip { display: none; }
  .navbar { top: 0; }
  .navbar__nav { display: none; }
  .navbar__actions .nav-link--small,
  .navbar__rule,
  .navbar__actions .theme-toggle { display: none; }
  .hamburger { display: inline-flex; }
  .dropdown { display: none; }
  .mobile-menu { padding-top: 72px; }
}
