/* ---------------------------------------------------------------
   Vox Mana Topbar — Batch 3
   Site-wide chrome. Replaces the previous topbar.css wholesale.
   Depends on: tokens.css, fonts.css
   --------------------------------------------------------------- */

:root {
  --vm-topbar-h: 64px;
  --vm-topbar-h-mobile: 56px;
  --vm-topbar-pad-x: clamp(16px, 4vw, 56px);
}

/* ---- shell ------------------------------------------------------ */
.vm-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(16px, 4vw, 64px);
  height: var(--vm-topbar-h);
  padding: 0 var(--vm-topbar-pad-x);
  background: linear-gradient(
    to bottom,
    rgba(12, 11, 10, 0.92) 0%,
    rgba(12, 11, 10, 0.78) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* hairline gold rule under the topbar — subtle, matches mockup */
.vm-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(184, 149, 74, 0.18) 20%,
    rgba(184, 149, 74, 0.32) 50%,
    rgba(184, 149, 74, 0.18) 80%,
    transparent 100%
  );
  pointer-events: none;
}

/* ---- brand (left) ----------------------------------------------- */
.vm-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--gold);
  transition: opacity 200ms ease;
}

.vm-brand:hover {
  opacity: 0.85;
}

.vm-brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid rgba(184, 149, 74, 0.72);
  filter: drop-shadow(0 0 10px rgba(184, 149, 74, 0.24));
  flex-shrink: 0;
  transform: rotate(45deg);
}

.vm-brand-mark::before,
.vm-brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(184, 149, 74, 0.42);
}

.vm-brand-mark::after {
  inset: 13px;
  background: rgba(212, 180, 97, 0.72);
  box-shadow: 0 0 10px rgba(212, 180, 97, 0.44);
}

.vm-brand-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  /* Subtle text shadow so it reads on bright background photos */
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

/* ---- nav (center) ----------------------------------------------- */
.vm-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 56px);
}

.vm-nav-link {
  position: relative;
  display: inline-block;
  padding: 8px 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 180ms ease;
  white-space: nowrap;
}

.vm-nav-link:hover,
.vm-nav-link:focus-visible {
  color: var(--gold-l);
}

.vm-nav-link[aria-current="page"] {
  color: var(--gold-l);
}

/* Active-state ornament: gradient underline + diamond bullet */
.vm-nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold) 25%,
    var(--gold-l) 50%,
    var(--gold) 75%,
    transparent 100%
  );
}

.vm-nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%) rotate(45deg);
  width: 5px;
  height: 5px;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(184, 149, 74, 0.6);
}

/* ---- utility menu (right) --------------------------------------- */
.vm-utility {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.vm-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--gold-quiet);
  border-radius: 999px;
  color: var(--gold-l);
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease,
    box-shadow 200ms ease;
}

.vm-menu-button:hover,
.vm-menu-button:focus-visible {
  border-color: var(--gold);
  background: rgba(184, 149, 74, 0.06);
  box-shadow: 0 0 16px rgba(184, 149, 74, 0.18);
}

.vm-menu-button[aria-expanded="true"] {
  border-color: var(--gold-l);
  background: rgba(184, 149, 74, 0.1);
}

.vm-menu-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.vm-menu-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-l);
  box-shadow: 0 0 4px rgba(212, 180, 97, 0.6);
}

/* ---- dropdown menu --------------------------------------------- */
.vm-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 240px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border-s);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(184, 149, 74, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 200ms ease, visibility 200ms ease, transform 200ms ease;
  z-index: 110;
}

.vm-menu-panel[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* corner brackets on dropdown for the artifact feel */
.vm-menu-panel::before,
.vm-menu-panel::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--gold-quiet);
  pointer-events: none;
}

.vm-menu-panel::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.vm-menu-panel::after {
  bottom: -1px;
  right: -1px;
  border-top: 0;
  border-left: 0;
}

.vm-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.vm-menu-item:hover,
.vm-menu-item:focus-visible {
  background: rgba(184, 149, 74, 0.06);
  color: var(--gold-l);
  outline: none;
}

.vm-menu-item-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.vm-menu-item[data-active="true"] .vm-menu-item-status {
  color: var(--gold-l);
}

/* ---- mobile ---------------------------------------------------- */
@media (max-width: 720px) {
  .vm-topbar {
    height: var(--vm-topbar-h-mobile);
  }

  .vm-brand-text {
    display: none;
  }

  .vm-nav {
    /* Compress navigation on small screens; rely on the hamburger
       menu (and future drawer) when space is critical. */
    gap: 16px;
  }

  .vm-nav-link {
    font-size: 0.75rem;
    letter-spacing: 0.16em;
  }
}

@media (max-width: 540px) {
  .vm-nav {
    /* Hide nav links entirely on phones; menu button becomes the
       primary nav entry point. The dropdown will gain nav links
       in Batch 2.6 polish. */
    display: none;
  }
}

/* ---- reduced-motion respect ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .vm-menu-panel {
    transition: opacity 0ms;
    transform: translateY(0);
  }
}

[data-vm-reduce-motion="true"] .vm-menu-panel {
  transition: opacity 0ms;
  transform: translateY(0);
}
