/* ============================================================
   REVY — Navigation (shared across all pages)
   Reads all tokens from design-system.css.

   Aligned to --max-width, not the POC's 1180px: every existing
   page lays out at 1440px, and a narrower nav would sit visibly
   inset from the content beneath it.
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  /* The rule is transparent until scrolled: at the top of the page the
     nav and the page share a surface and a line there is just noise. */
  border-bottom: 1px solid transparent;
  transition: border-color var(--t2) var(--ease);
}

.nav.scrolled {
  border-bottom-color: var(--color-rule);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Wordmark ───────────────────────────────────────────── */
.brand {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
}

.brand-mark {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--color-ink);
  white-space: nowrap;
}

.brand-mark .v {
  color: var(--color-red);
}

.brand-sub {
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-ink-dim);
  margin-top: 5px;
  white-space: nowrap;
}

/* ── Links ──────────────────────────────────────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  font-family: var(--f-body);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--color-ink-mid);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: color var(--t2) var(--ease), background var(--t2) var(--ease);
}

.nav-link:hover {
  color: var(--color-ink);
  background: var(--color-surface);
}

/* Outlined CTA. scale on :active because a button that does not move
   under the finger gives no evidence the interface heard the press. */
.nav-sell {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1.5px var(--color-rule-strong);
  transition: box-shadow var(--t2) var(--ease), transform var(--t1) var(--ease);
}

.nav-sell:hover {
  box-shadow: inset 0 0 0 1.5px var(--color-ink);
}

.nav-sell:active {
  transform: scale(0.97);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--color-rule-mid);
  flex-shrink: 0;
  margin: 0 4px;
  transition: border-color var(--t2) var(--ease), transform var(--t1) var(--ease);
}

.nav-avatar:hover {
  border-color: var(--color-rule-strong);
}

.nav-avatar:active {
  transform: scale(0.94);
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-auth-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Shown only in the mobile drawer, where the avatar is hidden. */
.nav-profile-link {
  display: none;
}

/* ── Hamburger ──────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  z-index: 10;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform var(--t2) var(--ease), opacity var(--t1) var(--ease);
}

.nav-hamburger.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav-right {
    gap: 2px;
  }

  .nav-link {
    padding: 7px 10px;
    font-size: 14px;
  }

  .nav-sell {
    padding: 7px 13px;
    font-size: 13.5px;
  }
}

@media (max-width: 560px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-right {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--color-rule);
    box-shadow: var(--shadow-md);
    padding: 8px var(--gutter) 14px;
  }

  .nav-right.open {
    display: flex;
  }

  .nav-right .nav-link {
    padding: 13px 0;
    font-size: 15px;
    border-radius: 0;
    border-bottom: 1px solid var(--color-rule);
  }

  .nav-right .nav-link:hover {
    background: none;
  }

  .nav-auth-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .nav-auth-group .nav-avatar {
    display: none;
  }

  .nav-auth-group .nav-profile-link {
    display: block;
  }

  .nav-sell {
    margin-top: 12px;
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    font-size: 15px;
  }
}
