/* ============================================================
   SECTION NAV — sticky left navigation component
   Quiet · Editorial · Minimal — guides without competing.
   Sentence case, no letterspacing, no badges. Weight is the
   only signal for active state (per reverse-engineered ref).
   ============================================================ */

[id] { scroll-margin-top: 76px; }

/* ── Desktop — fixed left rail, vertically centered ── */
.section-nav {
  position: fixed;
  left: clamp(20px, 2.6vw, 48px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  z-index: 40;
  display: flex;
  align-items: stretch;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.section-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.section-nav-track {
  width: 1px;
  flex-shrink: 0;
  background: var(--border);
  border-radius: 1px;
  position: relative;
}
.section-nav-progress {
  position: absolute;
  top: 0; left: 0; width: 100%;
  height: 0%;
  background: var(--gold);
  border-radius: 1px;
  transition: height .15s linear;
}

.section-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 62vh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 2px 4px 2px 0;
}
.section-nav-list::-webkit-scrollbar { display: none; }

.section-nav-link {
  display: block;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--t3);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0;
  padding: 1px 2px;
  border-radius: 3px;
  transition: color .25s var(--ease), font-weight .25s var(--ease);
}
.section-nav-link:hover { color: var(--t2); }
.section-nav-link.is-active { color: var(--t1); font-weight: 600; }
.section-nav-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* ── Mobile / collapsed toggle — floating pill, bottom-left ── */
.section-nav-toggle {
  display: none;
  position: fixed;
  left: clamp(16px, 4vw, 24px);
  bottom: clamp(16px, 4vw, 24px);
  z-index: 41;
  align-items: center;
  gap: 8px;
  background: rgba(7,8,12,0.92);
  border: 1px solid var(--border-hi);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--t1);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 11px 18px;
  border-radius: 100px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .4s var(--ease), transform .4s var(--ease), background .2s;
}
.section-nav-toggle.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.section-nav-toggle:hover { background: rgba(18,19,26,0.96); }
.section-nav-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.section-nav-toggle-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.section-nav-toggle-caret {
  width: 9px; height: 9px; flex-shrink: 0;
  transition: transform .3s var(--ease);
}
.section-nav-toggle[aria-expanded="true"] .section-nav-toggle-caret { transform: rotate(180deg); }

/* ── Responsive: below 1400px the fixed rail would collide with
   the 1200px container, so it becomes a toggled panel instead ── */
@media (max-width: 1400px) {
  .section-nav {
    display: none;
    left: clamp(16px, 4vw, 24px);
    bottom: 76px;
    top: auto;
    transform: none;
    flex-direction: column;
    background: rgba(12,13,19,0.98);
    border: 1px solid var(--border-hi);
    border-radius: var(--rl);
    padding: 20px 22px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .section-nav.is-mobile-open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
  }
  .section-nav-list { max-height: 50vh; }
  .section-nav-toggle { display: flex; }
}
@media (max-width: 640px) {
  .section-nav { right: 16px; left: 16px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .section-nav, .section-nav-toggle, .section-nav-link, .section-nav-progress { transition: none; }
}
