@media (max-width: 900px) {
  main {
    padding-top: 0.5rem;
    padding-bottom: 2.5rem;
  }

  .timeline,
  .edu-grid,
  .github-repos,
  .stats {
    grid-template-columns: 1fr;
  }

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

  .site-header {
    gap: 0.5rem;
  }

  .header-right {
    gap: 0.6rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    min-width: 11rem;
  }

  .hero h1 {
    max-width: 16ch;
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .hero {
    padding-top: 1.2rem;
    padding-bottom: 1rem;
  }

  .hero-title-row {
    align-items: center;
    gap: 0.8rem;
  }

  .hero-profile {
    width: 3.8rem;
    height: 3.8rem;
  }

  .hero-location-top {
    position: static;
    margin-top: 0.6rem;
    margin-right: auto;
    width: fit-content;
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
  }

  .header-location {
    flex-shrink: 0;
  }

  .secret-pill {
    order: 4;
  }

  .header-location span {
    white-space: nowrap;
  }

  .subtitle {
    flex-wrap: wrap;
    min-height: 3.2rem;
    align-items: flex-start;
  }

  .stats li {
    padding: 0.8rem;
  }

  .stats li strong {
    font-size: 1rem;
    line-height: 1.2;
  }

  .stats li span {
    font-size: 0.75rem;
    margin-top: 0.2rem;
  }

  .experience-card {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .hero-title-row {
    gap: 0.7rem;
  }

  .hero-profile {
    width: 3.1rem;
    height: 3.1rem;
  }

  .github-stats {
    grid-template-columns: 1fr;
  }

  .section-head-inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-toggle {
    width: 2.75rem;
    height: 2.75rem;
  }

  .theme-toggle.theme-icon {
    width: 2.75rem;
    height: 2.75rem;
  }

  .modal-close {
    width: 2.75rem !important;
    height: 2.75rem !important;
  }

  .doom-player {
    min-height: 240px;
  }
}

@media (max-width: 480px) {
  .header-location {
    display: none;
  }

  .header-right {
    gap: 0.45rem;
  }

  .contact-info strong {
    white-space: normal;
    word-break: break-all;
  }
}
