/* ============================================================
   NAVBAR + MOBILE DRAWER + LEGAL PAGES
   Clean architecture - drawer is direct body child
   ============================================================ */

/* ============================================================
   NAVBAR (top sticky pill)
   ============================================================ */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 32px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 16px;
  z-index: 100;
  animation: navFadeIn 500ms var(--ease) both;
}

@media (min-width: 840px) {
  .navbar {
    padding: 12px 20px;
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .navbar {
    padding: 14px 24px;
    margin-bottom: 48px;
  }
}

/* Opacity-only fade to avoid transform containing-block issue */
@keyframes navFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.navbar .brand {
  text-decoration: none;
  color: var(--text);
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.navbar .brand:hover { opacity: 0.8; }

/* ============================================================
   DESKTOP NAV LINKS (inline in navbar)
   ============================================================ */

.nav-links-desktop {
  display: none; /* hidden on mobile */
  gap: 4px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

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

.nav-links-desktop a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 999px;
  transition: all var(--transition);
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .nav-links-desktop a {
    padding: 9px 16px;
    font-size: 14px;
  }
}

.nav-links-desktop a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.nav-links-desktop a.active {
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 600;
}

/* ============================================================
   HAMBURGER BUTTON (mobile only)
   ============================================================ */

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition);
  flex-shrink: 0;
}

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

.nav-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--text);
}

@media (min-width: 840px) {
  .nav-toggle {
    display: none; /* hidden on desktop */
  }
}

/* Theme toggle visibility */
.navbar .theme-toggle-wrap {
  display: none;
}
@media (min-width: 840px) {
  .navbar .theme-toggle-wrap {
    display: inline-flex;
  }
}

/* ============================================================
   MOBILE DRAWER (direct body child, fixed positioned)
   ============================================================ */

.nav-links {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 70px 18px 24px;
  transform: translateX(100%);
  transition: transform 350ms var(--ease);
  z-index: 999;
  overflow-y: auto;
  overflow-x: hidden;
  visibility: hidden;
}

.nav-links.open {
  transform: translateX(0);
  visibility: visible;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.nav-links a.active {
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 600;
}

/* Close button inside drawer */
.nav-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.nav-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.nav-close svg { width: 16px; height: 16px; }

/* Drawer label */
.nav-drawer-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 0 18px;
  margin-bottom: 8px;
}

/* Theme toggle inside drawer (mobile only) */
.nav-links .theme-toggle-mobile {
  display: flex;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  justify-content: center;
}

/* Hide drawer on desktop */
@media (min-width: 840px) {
  .nav-links,
  .nav-close,
  .nav-drawer-label,
  .theme-toggle-mobile {
    display: none !important;
  }
}

/* ============================================================
   BACKDROP (direct body child)
   ============================================================ */

.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease);
}

.nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* When drawer open */
body.nav-open {
  overflow: hidden;
}

body.nav-open .navbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--surface);
}

/* ============================================================
   LEGAL PAGES
   ============================================================ */

.legal {
  max-width: 820px;
  margin: 0 auto;
  animation: fadeUp 600ms var(--ease) both;
}

.legal-header {
  text-align: center;
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .legal-header { margin-bottom: 72px; }
}

.legal-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  margin-bottom: 20px;
}

.legal-header h1 {
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
}

.legal-content section {
  margin-bottom: 44px;
  animation: fadeUp 600ms var(--ease) both;
}

.legal-content h2 {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .legal-content h2 { font-size: 26px; }
}

.legal-content p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 14px;
}

@media (min-width: 1024px) {
  .legal-content p { font-size: 16px; }
}

.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

.legal-content a {
  color: var(--accent-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.legal-content a:hover {
  border-bottom-color: var(--accent);
}

.legal-content ul {
  list-style: none;
  padding-left: 0;
  margin: 14px 0;
}

.legal-content ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.legal-content ul li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.contact-list li::before {
  background: var(--success) !important;
}

.callout {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  font-size: 15px;
  line-height: 1.6;
}

.callout.warning {
  background: color-mix(in srgb, #ff9f0a 14%, transparent);
  border-left-color: #ff9f0a;
  color: var(--text);
}

.callout strong {
  color: var(--text);
}

.callout ul {
  margin-top: 10px !important;
}
