/* ============================================
   Navigation — Desktop: left sidebar, Mobile: top bar
   ============================================ */

/* Desktop: vertical left sidebar */
@media (min-width: 769px) {
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 56px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    background: rgba(10, 10, 12, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
  }

  .nav.visible {
    transform: translateX(0);
    opacity: 1;
  }

  .nav-logo {
    font-size: 18px;
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s;
    margin-bottom: 16px;
  }
  .nav-logo:hover { opacity: 1; }

  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    width: 100%;
  }
  .nav-links::-webkit-scrollbar { display: none; }

  .nav-links a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.5px;
    padding: 6px 4px;
    width: 52px;
    text-align: center;
    position: relative;
    transition: color 0.3s, background 0.3s;
    border-radius: 4px;
    line-height: 1.3;
  }

  .nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: rgba(150, 130, 200, 0.6);
    transition: height 0.3s;
    border-radius: 1px;
  }

  .nav-links a:hover {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.03);
  }

  .nav-links a.active {
    color: var(--text);
    background: rgba(150, 130, 200, 0.08);
  }
  .nav-links a.active::after {
    height: 16px;
  }

  .nav-lang {
    color: rgba(200,160,255,0.5) !important;
    border: 1px solid rgba(200,160,255,0.2);
    border-radius: 4px;
    padding: 3px 6px !important;
    font-size: 9px !important;
    margin-top: 12px;
    width: auto;
  }
  .nav-lang:hover {
    border-color: rgba(200,160,255,0.5);
    color: rgba(200,160,255,1) !important;
  }
}

/* Mobile: horizontal top bar */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0;
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
  }

  .nav.visible {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-logo { display: none; }

  .nav-links {
    display: flex;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 2vw;
    gap: 0;
  }
  .nav-links::-webkit-scrollbar { display: none; }

  .nav-links a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 11px;
    padding: 0 0.9em;
    height: 44px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    transition: color 0.3s;
  }

  .nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: rgba(150, 130, 200, 0.5);
    transition: width 0.3s, left 0.3s;
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--text);
  }
  .nav-links a.active::after {
    width: 100%;
    left: 0;
  }

  .nav-lang {
    color: rgba(200,160,255,0.6) !important;
    border: 1px solid rgba(200,160,255,0.2);
    border-radius: 4px;
    padding: 2px 8px !important;
    height: auto !important;
    font-size: 10px !important;
    margin-left: 4px;
  }
  .nav-lang:hover {
    border-color: rgba(200,160,255,0.5);
    color: rgba(200,160,255,1) !important;
  }
}

/* ============================================
   Section Visualizations
   ============================================ */

.section-viz {
  margin-bottom: 3em;
  display: block;
  max-width: 100%;
  border-radius: 4px;
}

canvas.section-viz {
  height: auto;
  width: 100%;
}

/* Rhythm Bars (Daily Activity) */
.rhythm-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  margin-bottom: 3em;
  padding-bottom: 24px;
}

.rhythm-bar {
  flex: 1;
  height: var(--h);
  background: linear-gradient(to top, rgba(80, 220, 220, 0.4), rgba(160, 120, 240, 0.15));
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: height 0.5s ease;
  box-shadow: 0 0 12px rgba(80, 220, 220, 0.1);
}

.rhythm-bar:hover {
  background: linear-gradient(to top, rgba(80, 220, 220, 0.6), rgba(160, 120, 240, 0.3));
  box-shadow: 0 0 20px rgba(80, 220, 220, 0.2);
}

.rhythm-bar::after {
  content: attr(data-label);
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--dim);
  letter-spacing: 0.5px;
  font-family: var(--mono);
}
