/* ============================================================
   Responsive breakpoints
   Order: largest → smallest. Each block contains only
   layout changes that differ from the default desktop styles.
   ============================================================ */

/* ── ≤ 1100px ─ collapse hero to single column ─────────────── */
@media (max-width: 1100px) {
  .container--grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .grid-container-2 {
    display: none;
  }

  .aboutme-grid {
    grid-template-columns: 1fr;
  }

  .aboutme-container-2 {
    order: -1;
    max-width: 420px;
    margin: 0 auto;
  }

  .grid-containert-contact {
    grid-template-columns: 1fr;
  }
}

/* ── ≤ 900px ─ tighten skill cards, terminal ───────────────── */
@media (max-width: 900px) {
  .tech-stack-box {
    width: 130px;
    height: 130px;
  }

  .tech-stack-logo {
    width: 78px;
    height: 78px;
  }

  .terminal-window:hover {
    transform: none;
  }
}

/* ── ≤ 830px ─ mobile nav ──────────────────────────────────── */
@media (max-width: 830px) {
  .nav-links {
    display: none;
  }

  .nav-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .navbar {
    padding: 0.55rem 1rem;
  }
}

/* ── ≤ 720px ─ phone landscape ─────────────────────────────── */
@media (max-width: 720px) {
  .container {
    padding: 0 1.25rem;
  }

  .section-hero {
    padding-top: calc(var(--header-h) + 0.5rem);
  }

  .grid-container-1 {
    text-align: center;
    align-items: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-btns,
  .hero-links,
  .dev-showcase {
    justify-content: center;
  }

  .boxes {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
  }

  .box {
    padding: 1rem 0.5rem;
  }

  .box-number {
    font-size: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .section-about,
  .section-projects,
  .section-contact,
  .section-skills,
  .section-terminal {
    padding: 3.5rem 0;
  }

  .section-terminal {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .terminal-body {
    font-size: 0.8rem;
    padding: 1rem;
  }
}

/* ── ≤ 540px ─ phone portrait ──────────────────────────────── */
@media (max-width: 540px) {
  :root {
    --header-h: 76px;
  }

  body {
    font-size: 15px;
  }

  .logo-img {
    width: 38px;
    height: 38px;
  }

  .logo-text {
    font-size: 1.25rem;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .dev-showcase {
    font-size: 1.2rem;
  }

  .rotator {
    width: 16ch;
  }

  .contact-box {
    padding: 1.5rem 1.25rem;
  }

  .tech-stack-box {
    width: 110px;
    height: 110px;
    border-radius: 18px;
  }

  .tech-stack-logo {
    width: 64px;
    height: 64px;
  }

  .tech-stack-wrapper {
    gap: 1rem;
  }

  .project-image {
    height: 165px;
  }

  .buttons-projects {
    flex-direction: column;
  }
}

/* ── ≤ 400px ─ very small phones ───────────────────────────── */
@media (max-width: 400px) {
  .hero-title {
    font-size: 2rem;
  }

  .dev-showcase {
    font-size: 1.05rem;
  }

  .rotator {
    width: 14ch;
  }

  .boxes {
    grid-template-columns: 1fr;
  }

  .tech-stack-box {
    width: 96px;
    height: 96px;
  }

  .tech-stack-logo {
    width: 54px;
    height: 54px;
  }
}
