@media (max-width: 1120px) {
  .hero-grid,
  .split-layout,
  .case-body,
  .case-intro {
    grid-template-columns: 1fr;
  }

  .hero-card {
    max-width: 430px;
    margin-inline: auto;
  }

  .profile-principles,
  .stack-grid,
  .advanced-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stack-card.is-core {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }

  .case-header {
    grid-template-columns: 1fr;
  }

  .case-badges {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 880px) {
  :root {
    --header: 70px;
  }

  .shell {
    width: min(100% - 28px, var(--shell));
  }

  .nav-toggle {
    display: block;
  }

  .brand small {
    display: none;
  }

  .main-nav {
    position: fixed;
    top: var(--header);
    left: 14px;
    right: 14px;
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 160ms var(--ease), transform 160ms var(--ease);
  }

  .main-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .main-nav a,
  .tech-toggle {
    justify-content: flex-start;
    width: 100%;
  }

  .main-nav .nav-cta {
    margin-left: 0;
    justify-content: center;
  }

  .section {
    padding: 78px 0;
  }

  .hero {
    min-height: auto;
    padding: 104px 0 68px;
  }

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

  .section-heading h2,
  .final-box h2 {
    font-size: 2.25rem;
  }

  .career-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  body {
    padding-bottom: 66px;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .hero-card {
    order: -1;
    width: 100%;
  }

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

  .hero-lead {
    font-size: 1.16rem;
  }

  .hero-actions,
  .case-filters,
  .action-row,
  .code-tabs,
  .example-actions {
    display: grid;
  }

  .btn,
  .case-filters button,
  .case-action,
  .tab-button {
    width: 100%;
  }

  .hero-metrics,
  .profile-principles,
  .stack-grid,
  .advanced-grid,
  .process-list,
  .priority-grid {
    grid-template-columns: 1fr;
  }

  .stack-card.is-core {
    grid-column: span 1;
  }

  .portrait-frame img {
    height: 300px;
    object-position: center 32%;
  }

  .credential-card {
    position: static;
    max-width: none;
    margin-top: 10px;
  }

  .case-card,
  .career-card,
  .example-card {
    padding: 18px;
  }

  .case-header h3 {
    font-size: 1.45rem;
  }

  .simulation-output {
    min-height: 260px;
  }

  .code-panel pre {
    min-height: 260px;
    max-height: 330px;
    font-size: 0.75rem;
  }

  .final-box {
    padding: 28px 20px;
  }

  .footer-shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-whatsapp {
    display: flex;
  }

  .back-top {
    bottom: 76px;
  }
}
