/* ==========================================================================
   SIDEBAR — fixed left column, styled as a bound notebook spine
   ========================================================================== */

.sidebar {
  grid-column: 1;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  border-right: 1px solid var(--line-strong);
}



.sidebar__identity {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--paper-0);
  background: linear-gradient(155deg, var(--accent-ink), var(--accent));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar__name {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--sidebar-text);
  margin-bottom: 0.35em;
  line-height: 1.3;
}

.sidebar__role {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--sidebar-role);
  letter-spacing: 0.03em;
  line-height: 1.65;
  padding: 0 var(--space-xs);
  margin: 0 auto;
  max-width: 250px;
  text-align: center;
  word-break: break-word;
  opacity: 0.92;
}

/* Nav — index tabs with a sliding marker (the signature element) */
.sidebar__nav {
  position: relative;
  flex: 1;
}

.nav__list {
  position: relative;
  display: flex;
  flex-direction: column;
}

.nav__marker {
  position: absolute;
  left: -0.9rem;
  width: 3px;
  height: 2.1rem;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease);
  transform: translateY(0);
}

.nav__item + .nav__item { margin-top: 0.15rem; }

.nav__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.65em;
  padding: 0.55em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--sidebar-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.nav__link .num {
  color: var(--sidebar-text-muted);
  opacity: 0.75;
  font-size: 0.72rem;
}

.nav__link:hover {
  color: var(--sidebar-text-active);
  background: var(--accent-soft);
  text-decoration: none;
}

.nav__item.is-active .nav__link {
  color: var(--sidebar-text-active);
  font-weight: 600;
}
.nav__item.is-active .nav__link .num {
  color: var(--sidebar-role);
  opacity: 1;
  font-weight: 600;
}

/* Socials */
.sidebar__socials {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.social-link {
  color: var(--sidebar-text-muted);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.social-link:hover {
  color: var(--sidebar-role);
  transform: translateY(-2px);
}
.social-link svg { width: 18px; height: 18px; display: block; }

/* Theme toggle — Light / Dark / System, Chirpy-style segmented control */
.theme-toggle {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}
.theme-toggle button {
  flex: 1;
  padding: 0.5em 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--sidebar-text-muted);
  border-right: 1px solid var(--line-strong);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.theme-toggle button:last-child { border-right: none; }
.theme-toggle button:hover { color: var(--sidebar-text-active); }
.theme-toggle button.is-active {
  background: var(--accent);
  color: #0b0e14;
  font-weight: 600;
}

.sidebar__foot {
  margin-top: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--sidebar-text-muted);
  text-align: center;
}

/* Mobile top bar (hidden on desktop) */
.topbar { display: none; }
