/* ── BRAND AS HOME LINK ── */
a.brand {
  text-decoration: none;
  color: inherit;
}

/* ── BRAND FONT SCALE ── */
.brand {
  font-size: clamp(0.95rem, 2.5vw, 1.6rem);
  letter-spacing: -0.05em;
}

/* ── HAMBURGER — desktop only fallback ── */
.nav-toggle {
  display: none;
}

/* ── BOTTOM NAV — hidden on desktop ── */
.mobile-bottom-nav {
  display: none;
}

/* ════════════════════════════════
   MOBILE ≤ 820px
════════════════════════════════ */
@media (max-width: 820px) {
  body {
    padding: 10px 8px 72px; /* space for bottom nav */
  }

  /* ── FIX min-height ── */
  .shell {
    grid-template-columns: 1fr;
    box-shadow: 6px 6px 0 var(--black);
    min-height: unset !important;
  }

  /* ── SIDEBAR → slim top bar ── */
  .sidebar {
    border-right: none;
    border-bottom: 3px solid var(--black);
    padding: 10px 14px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    flex-wrap: nowrap;
  }

  .brand {
    margin-bottom: 0;
  }

  /* Hide hamburger and sidebar nav — bottom nav handles this */
  .nav-toggle,
  .nav,
  .sidebar-bottom {
    display: none !important;
  }

  /* Show socials in sidebar top bar */
  .sidebar-socials-mobile {
    display: flex;
    gap: 8px;
  }

  /* ── MAIN ── */
  .main {
    padding: 10px;
  }

  .panel {
    padding: 12px;
    gap: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search {
    width: 100%;
  }

  /* ── BOTTOM NAV ── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--white);
    border-top: 3px solid var(--black);
    box-shadow: 0 -4px 0 var(--black);
  }

  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--black);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    border-right: 2px solid var(--black);
    transition: background 0.15s ease;
    min-height: 56px;
  }

  .mbn-item:last-child {
    border-right: none;
  }

  .mbn-item.active {
    background: var(--black);
    color: var(--white);
  }

  .mbn-item.active .mbn-icon {
    background: var(--yellow);
    color: var(--black);
  }

  .mbn-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 2px solid var(--black);
    background: var(--white);
    font-size: 0.65rem;
    font-weight: 800;
  }

  .mbn-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  /* ── MODALS MOBILE ── */
  .overlay,
  .modal-overlay {
    padding: 8px !important;
    align-items: flex-start;
    z-index: 1100 !important; /* above bottom nav (999) */
  }

  .modal {
    width: 100% !important;
    margin: 0 !important;
    box-shadow: 4px 4px 0 var(--black) !important;
  }

  .modal-header {
    padding: 12px 14px !important;
    gap: 10px;
  }

  .modal-title {
    font-size: 1.1rem !important;
    line-height: 1.2;
  }

  .modal-body {
    padding: 14px !important;
    gap: 14px !important;
  }

  .modal-cols {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .modal-metrics {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .modal-footer {
    padding: 12px 14px !important;
    gap: 8px;
  }

  .modal-btn {
    font-size: 0.8rem !important;
    padding: 8px 14px !important;
  }

  .metric-box {
    padding: 10px !important;
  }

  .metric-box strong {
    font-size: 1.1rem !important;
  }

  .modal-chips,
  .modal-stack {
    gap: 6px;
  }

  .modal-chip,
  .stack-chip {
    font-size: 0.68rem !important;
    padding: 4px 8px !important;
  }

  /* ── INTRO STRIP MOBILE ── */
  .intro-strip {
    flex-direction: column !important;
    gap: 12px;
  }

  .intro-strip .action-btn,
  .action-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* ── PROJECTS GRID MOBILE ── */
  .projects-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── HIDE reviews section on mobile (index.html) ── */
  .reviews {
    display: none !important;
  }
}

/* ════════════════════════════════
   SMALL ≤ 520px
════════════════════════════════ */
@media (max-width: 520px) {
  body {
    padding: 6px 4px 72px;
  }

  .shell {
    box-shadow: 3px 3px 0 var(--black);
  }

  .panel {
    padding: 10px;
    gap: 14px;
  }

  .page-title {
    font-size: 1.7rem !important;
  }

  .stack-title {
    font-size: 1.3rem;
  }

  .profile-card {
    grid-template-columns: 1fr !important;
  }

  .photo-frame {
    min-height: 220px !important;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .hero-grid,
  .reviews-grid {
    grid-template-columns: 1fr !important;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .top-actions,
  .profile-head,
  .cta-row,
  .score-top {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn,
  .secondary-btn,
  .mini-btn,
  .ghost-btn {
    width: 100%;
    text-align: center;
    display: block;
    padding: 12px;
  }

  .experience-card {
    grid-template-columns: 1fr !important;
  }

  .experience-tags {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-metrics {
    grid-template-columns: 1fr !important;
  }

  .modal-title {
    font-size: 1rem !important;
  }

  /* Bottom nav smaller screens */
  .mbn-label {
    font-size: 0.52rem;
  }

  .mbn-icon {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
  }
}
