/* Shared site chrome: top bar + side drawer (see nav.js).
   Ported directly from the Website v3 nav pattern (css/style.css: .nav,
   .nav-wordmark, .nav-toggle-grid, .nav-mobile) so the portal and study
   pages read as the same brand — dark walnut bar, dot-grid toggle that
   echoes the logo's mosaic mark, wordmark in text (not a squashed image),
   panel sliding in from the right. Falls back to the same hex values if a
   page's own stylesheet hasn't defined the brand tokens yet. */

body { padding-top: 68px; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  background: var(--walnut, #1C1410);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 30;
}

.topbar-wordmark {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-decoration: none;
}
.topbar-wordmark em { font-style: normal; color: var(--orange, #E87830); }
.topbar-wordmark small {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-left: 6px;
}

.nav-toggle {
  appearance: none;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  flex: none;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.06); }

/* Dot-grid toggle: 3×3 grid, centre dot hidden — matches the logo's mosaic mark */
.nav-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 20px;
  height: 20px;
}
.nav-toggle-grid span {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.7);
  transition: background 150ms ease;
}
.nav-toggle-grid span:nth-child(5) { background: transparent; }
.nav-toggle:hover .nav-toggle-grid span:not(:nth-child(5)) { background: var(--orange, #E87830); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 8, 0.55);
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 40;
}
.nav-backdrop.show { opacity: 1; }

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 86vw;
  background: var(--walnut, #1C1410);
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.28);
  transform: translateX(100%);
  transition: transform 220ms ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 22px 26px 28px;
  overflow-y: auto;
}
.nav-drawer.open { transform: translateX(0); }

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}

.nav-close {
  appearance: none;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  border-radius: 6px;
  flex: none;
}
.nav-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange, #E87830);
  margin: 0 0 12px;
}

.nav-links { display: flex; flex-direction: column; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 2px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 150ms ease;
}
.nav-link:hover { color: #fff; }
.nav-link-icon { display: flex; color: var(--terracotta, #C85C2C); flex: none; }
.nav-link-active { color: #fff; }
.nav-link-active .nav-link-icon { color: var(--orange, #E87830); }
