/* Psychopathia Machinalis — shared top navigation.
 * Used by /index.html, /mcp.html, /clinic/index.html.
 * Pattern inspired by SaferAgenticAI; palette is Psychopathia
 * (navy #2c3e50, slate #5a7a9b, warm accent #a0826d).
 */

:root {
  --nav-primary: #1a252f;
  --nav-primary-2: #2c3e50;
  --nav-accent: #a0826d;
  --nav-accent-hover: #b89684;
  --nav-text: rgba(255, 255, 255, 0.85);
  --nav-text-hover: #fff;
  /* Higher than the book banner (z-index:1000) on index.html */
  --z-nav: 1100;
}

/* Make #anchor jumps account for the 60px fixed site-nav — otherwise
 * the target's top lands behind the nav and users see the previous section. */
html { scroll-padding-top: 60px; }

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: linear-gradient(135deg, var(--nav-primary) 0%, var(--nav-primary-2) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  z-index: var(--z-nav);
  font-family: 'Poppins', -apple-system, system-ui, sans-serif;
  font-size: 15px;
}

.site-nav a {
  text-decoration: none;
  color: var(--nav-text);
  transition: color 0.2s, background 0.2s, transform 0.15s;
}

.site-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 1.02rem;
}
.site-nav .nav-brand:hover { color: #fff; }
.site-nav .nav-brand .nav-icon {
  width: 32px;
  height: 32px;
  display: block;
  /* Icon artwork is already framed; no background or radius needed. */
}

.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav .nav-link {
  padding: 7px 14px;
  border-radius: 6px;
  color: var(--nav-text);
  font-weight: 500;
  font-size: 0.93rem;
}
.site-nav .nav-link:hover {
  color: var(--nav-text-hover);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.site-nav .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  position: relative;
}
.site-nav .nav-link.active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  background: var(--nav-accent);
  border-radius: 1px;
}

.site-nav .nav-cta {
  margin-left: 8px;
  padding: 7px 16px;
  border-radius: 6px;
  background: var(--nav-accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.92rem;
}
.site-nav .nav-cta:hover {
  background: var(--nav-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.site-nav .nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
}

/* Every page that uses .site-nav needs room at the top so content doesn't
 * hide behind the fixed bar. */
.has-site-nav { padding-top: 60px; }

@media (max-width: 760px) {
  .site-nav { padding: 0 18px; }
  .site-nav .nav-brand .brand-name { display: none; }
  .site-nav .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--nav-primary) 0%, var(--nav-primary-2) 100%);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    transform: translateY(-120%);
    transition: transform 0.25s;
  }
  .site-nav .nav-links.open { transform: translateY(0); }
  .site-nav .nav-link,
  .site-nav .nav-cta { width: 100%; text-align: center; }
  .site-nav .nav-toggle { display: inline-block; }
}
