/* Final mobile overrides loaded last to prevent desktop styles from forcing overflow. */
html,
body {
  overflow-x: hidden;
}

img,
svg,
object {
  max-width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .container {
    width: min(var(--max), calc(100% - 24px));
  }

  .nav {
    gap: 10px;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-actions .icon-button[data-open-assistant],
  .nav-actions .download {
    display: none;
  }

  .nav-toggle {
    padding: 8px 10px;
  }

  .home-page .status-line {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .home-page .status-line span {
    border-radius: 10px;
    white-space: normal;
  }

  .home-page .hero-actions .button {
    width: 100%;
    justify-content: space-between;
  }

  #projects .project-browser .project-detail {
    padding: 20px !important;
  }

  #projects .project-browser .project-side {
    display: block;
  }

  #projects .project-browser .project-side .project-stack {
    margin-top: 8px;
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .home-page .system-visual {
    min-height: 280px;
    background-position: center 22px;
    background-size: min(72vw, 220px);
    box-shadow: inset 0 0 0 1px var(--line), 8px 8px 0 color-mix(in srgb, var(--accent) 14%, transparent);
  }

  .home-page .system-visual::after {
    top: 12px;
    left: 12px;
  }

  .home-page .system-visual::before {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .page-shell {
    padding-top: 84px;
  }

  .page-heading h1 {
    font-size: clamp(32px, 11vw, 48px);
  }

  .case-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .case-head,
  .case-body,
  .case-columns section {
    min-width: 0;
  }

  .case-status,
  .case-tech span,
  .tag,
  .status-badge,
  .project-action {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .resume {
    padding: 22px 14px;
  }

  .resume-contact {
    justify-content: flex-start;
    gap: 6px 10px;
  }

  .resume-contact a,
  .resume-contact span {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .home-page .system-visual {
    min-height: 250px;
    background-position: center 18px;
    background-size: min(76vw, 190px);
  }

  .hero h1,
  .home-page .hero h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  .section-title {
    font-size: clamp(26px, 9vw, 34px);
  }

  .contact-title {
    font-size: clamp(32px, 13vw, 46px);
  }

  .button,
  .icon-button {
    font-size: 11px;
  }

  .site-header .brand small {
    display: none;
  }
}
