/* Mobile layout hardening for narrow phones and older Safari/WebView. */
html,
body,
#root,
main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body {
  overflow-x: hidden;
}

.hero > *,
.manifesto > *,
.case-file > *,
.routine > *,
.recruit > *,
footer > * {
  min-width: 0;
}

.hero h1,
.manifesto h2,
.section-heading h2,
.case-file__copy h3,
.routine h2,
.recruit h2,
.facts dd {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .case-file__photo,
  .case-file:nth-of-type(odd) .case-file__photo {
    width: 100%;
    max-width: 100%;
    transform: none;
    box-shadow: 8px 8px 0 var(--ink);
  }

  .evidence-card:nth-child(n) {
    max-width: 100%;
    transform: none;
  }

  .recruit__panel {
    width: calc(100% - 8px);
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .brand {
    min-width: 0;
    gap: 0.5rem;
  }

  .brand__mark {
    width: 32px;
    flex: 0 0 auto;
  }

  .brand > span:last-child {
    font-size: 0.56rem;
    white-space: nowrap;
  }

  .topbar__status {
    font-size: 0;
  }

  .hero__copy {
    min-height: 570px;
    padding-top: 6rem;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(3.45rem, 21vw, 5.7rem);
    line-height: 0.78;
  }

  .hero h1 span {
    font-size: 0.36em;
  }

  .hero__actions {
    width: 100%;
    flex-direction: column;
  }

  .hero__actions .button {
    width: 100%;
  }

  .hero__portraits {
    min-height: 500px;
  }

  .manifesto h2,
  .section-heading h2,
  .routine h2,
  .recruit h2 {
    font-size: clamp(2.8rem, 15vw, 4.8rem);
    line-height: 0.9;
  }

  .section-heading {
    margin-bottom: 3rem;
  }

  .case-file {
    gap: 2rem;
    margin-bottom: 5rem;
  }

  .case-file__photo,
  .case-file__photo img {
    min-height: 360px;
  }

  .case-file__copy h3 {
    max-width: 100%;
    font-size: clamp(3.2rem, 19vw, 5.4rem);
    line-height: 0.78;
  }

  .case-file__number {
    right: 0;
    font-size: clamp(6rem, 32vw, 9rem);
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .timeline li {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 0.85rem;
  }

  .timeline time {
    font-size: 1.8rem;
  }

  .recruit__panel {
    padding: 1.1rem;
    box-shadow: 6px 6px 0 var(--ink);
  }

  footer {
    gap: 1.5rem 1rem;
  }
}

@media (max-width: 360px) {
  .brand > span:last-child {
    font-size: 0.52rem;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 20vw, 4.5rem);
  }

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

  .metrics div,
  .metrics div:nth-child(2),
  .metrics div:nth-child(n + 3) {
    min-height: 105px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .metrics div:last-child {
    border-bottom: 0;
  }

  .case-file__photo,
  .case-file__photo img {
    min-height: 320px;
  }

  footer {
    grid-template-columns: 1fr;
  }

  footer p:nth-of-type(2),
  footer > a {
    grid-column: 1;
  }
}
