/*
 * Profile responsive corrections.
 * Tablet portrait is an intentional stacked composition; mobile content is
 * contained so long Japanese labels cannot enlarge the CSS grid.
 */

.portfolio-services__layout,
.portfolio-services__media,
.portfolio-services__content,
.portfolio-services__list,
.portfolio-services__button,
.portfolio-services__copy {
  min-width: 0;
}

.portfolio-services__media,
.portfolio-services__content {
  width: 100%;
  max-width: 100%;
}

.portfolio-services__name {
  min-width: 0;
  flex-wrap: wrap;
}

.portfolio-services__desc {
  overflow-wrap: anywhere;
}

/* Short desktop viewports: keep the CTA and proof row from colliding. */
@media (min-width: 1101px) and (max-height: 840px) {
  .profile-fv-proofbar {
    bottom: 40px !important;
  }
}

/* Compact tablet: message, proof, photo and three works in reading order. */
@media (min-width: 768px) and (max-width: 900px) {
  .site-header .gnav-wrap {
    display: none !important;
  }

  .profile-fv {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .profile-fv-copy {
    display: block !important;
    height: auto !important;
    overflow: hidden !important;
  }

  .profile-fv-copy-inner {
    display: block !important;
    padding: 56px 48px 36px !important;
  }

  .profile-fv-kicker {
    margin-bottom: 20px !important;
    font-size: .72rem !important;
  }

  .profile-fv-title {
    width: 100% !important;
    max-width: 660px !important;
    font-size: clamp(2.55rem, 6vw, 3.15rem) !important;
    line-height: 1.42 !important;
  }

  .profile-fv-lead {
    width: 100% !important;
    max-width: 640px !important;
    margin: 24px 0 28px !important;
    font-size: .94rem !important;
    line-height: 1.95 !important;
  }

  .profile-fv-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 220px)) !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .profile-fv-cta {
    width: 100% !important;
    min-height: 56px !important;
  }

  .profile-fv-proofbar {
    position: relative !important;
    inset: auto !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 30px !important;
    min-height: 112px !important;
    height: auto !important;
    padding: 20px 48px !important;
  }

  .profile-fv-proofbar ul {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    padding: 0 0 0 28px !important;
    border-left: 1px solid #d8e1ec !important;
  }

  .profile-fv-stage {
    height: auto !important;
    padding: 0 0 36px !important;
    overflow: visible !important;
  }

  .profile-fv-main-media {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 8 !important;
  }

  .profile-fv-main-media img {
    object-position: 50% 44% !important;
  }

  .profile-fv-selected-label {
    display: none !important;
  }

  .profile-fv-service-cards {
    position: relative !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: auto !important;
    height: auto !important;
    margin: -52px 24px 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .profile-fv-service-card {
    min-width: 0 !important;
    min-height: 286px !important;
    height: auto !important;
    padding: 17px !important;
  }

  .profile-fv-card-head {
    grid-template-columns: 26px minmax(0, 1fr) !important;
    min-height: 54px !important;
  }

  .profile-fv-service-card h2 {
    font-size: .9rem !important;
  }

  .profile-fv-card-head p {
    font-size: .64rem !important;
  }

  .profile-fv-service-card > img {
    height: 92px !important;
  }

  .profile-fv-card-caption {
    min-height: 32px !important;
    font-size: .68rem !important;
  }

  .profile-fv-card-metric {
    font-size: .66rem !important;
    white-space: normal !important;
  }

  .profile-fv-card-metric strong {
    font-size: 1.55rem !important;
  }

  .portfolio-services__layout {
    grid-template-columns: 1fr !important;
    gap: 38px !important;
  }

  .portfolio-services__media {
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }

  .portfolio-services__media img {
    object-position: 50% 44% !important;
  }

  .portfolio-services__head .pf-lead br,
  .portfolio-services__desc br {
    display: none;
  }
}

@media (max-width: 767px) {
  .site-header {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .profile-fv-stage {
    overflow: visible !important;
  }

  .profile-fv-service-cards,
  .profile-fv-service-card {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .profile-fv-service-card {
    overflow: hidden;
  }

  .profile-fv-proof b {
    font-size: .75rem !important;
  }

  .profile-fv-proof-copy small {
    font-size: .62rem !important;
  }

  .profile-fv-proofbar li {
    font-size: .65rem !important;
    line-height: 1.45 !important;
  }

  .portfolio-services__layout {
    width: calc(100% - 40px) !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .portfolio-services__media {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 10 !important;
  }

  .portfolio-services__media img {
    width: 100% !important;
    max-width: 100% !important;
    object-position: 50% 43% !important;
  }

  .portfolio-services__head .pf-lead br,
  .portfolio-services__desc br {
    display: none;
  }

  .portfolio-services__button {
    max-width: 100%;
  }
}

@media (max-width: 390px) {
  .portfolio-services__layout {
    width: calc(100% - 32px) !important;
  }

  .portfolio-services__media {
    height: auto !important;
    aspect-ratio: 16 / 10 !important;
  }
}
