/* ============================================================
   MONTERA SYSTEMS — NAVIGATION
   Desktop nav + mobile drawer
   ============================================================ */

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  transition:
    background-color var(--duration-slow) var(--ease-out),
    backdrop-filter var(--duration-slow) var(--ease-out),
    border-bottom-color var(--duration-slow) var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background-color: rgba(206, 198, 185, 0.94);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom-color: var(--color-border);
}

/* ============================================================
   NAV INNER
   ============================================================ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: var(--space-6);
}

/* ============================================================
   LOGO
   ============================================================ */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo:hover .logo-wordmark .logo-name {
  opacity: 0.85;
}

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 0.04em;
  transition: opacity var(--duration-fast);
}

.logo-sub {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* ============================================================
   DESKTOP NAV LINKS
   ============================================================ */
.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  position: relative;
  transition:
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.nav-links a:hover {
  color: var(--color-text);
  background: rgba(53, 48, 42, 0.06);
}

.nav-links a.active {
  color: var(--color-text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: var(--space-4);
  right: var(--space-4);
  height: 1.5px;
  background: var(--color-text);
  border-radius: 1px;
}

/* ============================================================
   NAV CTA (desktop)
   ============================================================ */
.nav-cta {
  display: none;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .nav-cta {
    display: inline-flex;
  }
}

/* ============================================================
   HAMBURGER TOGGLE
   ============================================================ */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0;
  flex-shrink: 0;
  transition: border-color var(--duration-fast);
}

.nav-toggle:hover {
  border-color: var(--color-border-hover);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--color-text-muted);
  border-radius: 2px;
  transform-origin: center;
  transition:
    transform var(--duration-base) var(--ease-out),
    opacity var(--duration-base) var(--ease-out),
    background-color var(--duration-fast);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
  background: var(--color-text);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
  background: var(--color-text);
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(53, 48, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-nav) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-out);
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  z-index: var(--z-nav);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-drawer.open {
  transform: translateX(0);
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.nav-drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--duration-fast);
}

.nav-drawer-close:hover {
  background: rgba(53, 48, 42, 0.06);
  color: var(--color-text);
}

.nav-drawer-close svg {
  width: 16px;
  height: 16px;
}

.nav-drawer-links {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.nav-drawer-links a {
  display: flex;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition:
    color var(--duration-fast),
    background-color var(--duration-fast);
}

.nav-drawer-links a:hover,
.nav-drawer-links a.active {
  color: var(--color-text);
  background: rgba(53, 48, 42, 0.06);
}

.nav-drawer-links a.active {
  color: var(--color-text);
  background: rgba(53, 48, 42, 0.1);
}

.nav-drawer-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.nav-drawer-footer .btn {
  width: 100%;
}

/* ============================================================
   SKIP LINK (accessibility)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--color-accent);
  color: #E6E3E0;
  border-radius: var(--radius-md);
  font-weight: 500;
  z-index: var(--z-toast);
  text-decoration: none;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: var(--space-4);
}
