/* ========= MOBILE (≤768px) ========= */
@media (max-width: 768px) {
  /* Top nav container — only targets your header nav */
  .site-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* Mobile top row */
  .mobile-nav {
    display: flex !important;
    align-items: center;
    padding: 15px 20px;
    background-color: #000;
    justify-content: space-between;
    width: 100%;
    z-index: 999;
    position: fixed;
    top: 0;
    left: 0;
  }

  .hamburger {
    font-size: 28px;
    cursor: pointer;
    color: white;
    user-select: none;
    background: none;
    border: 0;
  }

  /* Hide nav links + search by default on mobile */
  #nav-links,
  .left-search-container {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: #111;
    padding: 10px 20px;
  }

  /* Show nav/search when toggled */
  #nav-links.show,
  .left-search-container.show {
    display: flex;
    align-items: center;
  }

  #nav-links li {
    margin: 10px 0;
    text-align: center;
    list-style: none;
  }

  #nav-links a {
    color: #fff;
    text-decoration: none;
  }

  .input-button-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .input-button-row input,
  .input-button-row button {
    width: 90%;
  }

  /* Header text section */
  .header-text {
    top: 150px;
    left: 20px;
    right: 20px;
    font-size: 20px;
    text-align: center;
    position: relative;
  }

  .header-text h1 { font-size: 30px; }
  .typing-container { font-size: 20px; }

  /* Skills */
  .skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    padding: 0 10px;
    gap: 12px;
  }

  /* Company logos */
  .company-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 0 10px;
  }

  .company-logo { width: 60px; height: auto; }

  /* Projects */
  .work-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    gap: 20px;
  }

  .work-item { width: 100%; max-width: 350px; }
  .work-item img { height: auto; }
}

/* ========= DESKTOP (≥769px) ========= */
@media (min-width: 769px) {
  .mobile-nav { display: none; }

  #nav-links,
  .left-search-container {
    display: flex !important;
    flex-direction: row;
    background: none;
    align-items: center;
  }

  /* Make sure only the header nav is affected */
  .site-nav { display: flex !important; }
}

/* ========= Slide-down menu (mobile) ========= */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: #111;
  width: 100%;
  padding: 10px 20px;
  position: fixed;
  top: 60px;
  left: 0;
  z-index: 998;
}
.mobile-menu a {
  color: white;
  text-decoration: none;
  padding: 10px 0;
  font-size: 18px;
  border-bottom: 1px solid #333;
}

/* Push content down on pages that need it */
.about-wrapper { padding-top: 120px; }

@media (min-width: 769px) {
  .mobile-nav,
  .mobile-menu { display: none !important; }
}

/* ========= Bottom mobile tab bar (≤768px) ========= */
@media (max-width: 768px) {
  :root { --safe-bot: env(safe-area-inset-bottom, 0px); }

  /* Keep content visible above the fixed bar */
  body { padding-bottom: calc(64px + var(--safe-bot)); }

  .mobile-bottom{
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 64px;
    padding-bottom: var(--safe-bot);
    background: #0f0f0f;
    border-top: 1px solid #1e1e1e;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
  }

  .mobile-bottom .tab{
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #cfcfcf;
    font-size: 11px;
    line-height: 1;
    padding-top: 6px;
  }

  .mobile-bottom .tab svg{
    width: 22px; height: 22px;
    fill: currentColor;
    display: block;
  }

  .mobile-bottom .tab:active,
  .mobile-bottom .tab.active{
    color: #ffffff;
  }
}

/* Hide bottom bar on desktop */
@media (min-width: 769px){
  .mobile-bottom{ display: none !important; }
}

/* Footer breathing room */
.site-footer { padding-bottom: 16px; }
