/* ==========================================================================
   Side navigation
   Persistent on desktop (a fixed column down the left edge), a slide-in
   drawer on smaller screens (opened by the header's hamburger button).
   Only touch this file + sidenav.js to change how in-page navigation works.
   ========================================================================== */

.side-nav {
  position: fixed;
  inset-block: 0;
  left: 0;
  width: var(--sidenav-width);
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md) var(--space-md) var(--space-lg);
  transform: translateX(-120%);
  transition: transform var(--transition-base) var(--ease-out);
}

/* Browsers without backdrop-filter support fall back to a plain, still
   readable panel instead of an overly transparent one. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .side-nav {
    background: var(--color-bg-alt);
  }
}

.side-nav-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.side-nav-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-indigo-deep);
  padding: 0.25rem;
}

.side-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.side-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(100, 113, 165, 0.4);
  flex-shrink: 0;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.side-nav-link:hover {
  background: rgba(90, 55, 195, 0.08);
  color: var(--color-indigo-deep);
}

.side-nav-link.is-active {
  background: rgba(90, 55, 195, 0.1);
  color: var(--color-indigo-deep);
}

.side-nav-link.is-active .side-nav-dot {
  background: var(--gradient-accent);
  transform: scale(1.3);
}

.side-nav-footer {
  padding-top: var(--space-md);
  border-top: 1px solid rgba(40, 16, 115, 0.08);
}

.side-nav-contact {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-slate);
  word-break: break-word;
}

.side-nav-contact:hover {
  color: var(--color-orange);
}

.side-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 21, 51, 0.45);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base) ease;
}

/* ---- Mobile / tablet: drawer behavior ----
   A frosted slide-in drawer, flush to the left edge, rounded on its
   trailing corners so it still reads as a distinct floating panel over
   the dimmed backdrop rather than a flat sheet. */
@media (max-width: 1099px) {
  .side-nav {
    top: 0;
    height: 100vh;
    border-left: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  }

  .side-nav.is-open {
    transform: translateX(0);
  }

  .side-nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ---- Desktop: a compact floating card, vertically centered and inset
   from the edge — see-through (blurred glass) but never full-height or
   flush to the edge, so it reads as a light dock rather than a solid,
   bulky column. ---- */
@media (min-width: 1100px) {
  .side-nav {
    top: 50%;
    bottom: auto;
    left: var(--sidenav-offset);
    transform: translateY(-50%);
    height: auto;
    max-height: calc(100vh - (var(--sidenav-offset) * 2));
    overflow-y: auto;
    border-radius: var(--radius-lg);
    padding-top: var(--space-md);
  }

  .side-nav-close {
    display: none;
  }

  .side-nav-brand {
    display: none;
  }

  .side-nav-overlay {
    display: none;
  }
}
