/* Focused QA fixes layered after the main visual theme. */

:root {
  --qa-motion-standard: cubic-bezier(0.22, 1, 0.36, 1);
}

:where(h1, h2, h3, h4, .project-name, .part-title) {
  text-wrap: balance;
  line-break: strict;
}

:where(p, li, .section-desc, .hero-desc, .project-desc, .strategy-summary) {
  text-wrap: pretty;
  line-break: strict;
  overflow-wrap: break-word;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent, #d44a2c);
  outline-offset: 4px;
}

img {
  max-width: 100%;
}

.project-card,
.first-featured-project,
.featured-project-card,
.project-img,
.project-arrow {
  transition-duration: 520ms !important;
  transition-timing-function: var(--qa-motion-standard) !important;
}

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 32px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition:
    opacity 260ms ease,
    transform 360ms var(--qa-motion-standard),
    visibility 0s linear 360ms;
}

.mobile-menu.open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

body.detail-page-active .detail-meta {
  grid-template-columns:
    minmax(96px, 0.72fr)
    minmax(78px, 0.55fr)
    minmax(130px, 0.95fr)
    minmax(210px, 1.55fr)
    minmax(260px, 1.8fr);
  align-items: start;
}

body.detail-page-active .meta-item {
  min-width: 0;
}

body.detail-page-active .meta-item > span {
  display: block;
  text-wrap: pretty;
  line-break: strict;
}

body.detail-page-active .meta-item .meta-term {
  display: inline-block;
  white-space: nowrap;
}

body.detail-page-active .case-index-links {
  scrollbar-width: none;
}

body.detail-page-active .case-index-links::-webkit-scrollbar {
  display: none;
}

@media (hover: none) {
  .project-card:hover,
  .first-featured-project:hover,
  .featured-project-card:hover {
    transform: none !important;
  }

  .project-card:hover .project-img,
  .first-featured-project:hover img,
  .featured-project-card:hover img,
  .project-card:hover .project-arrow {
    transform: none !important;
  }
}

@media (max-width: 1040px) {
  body.detail-page-active .detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.detail-page-active .detail-meta .meta-item:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body.detail-page-active .detail-meta {
    grid-template-columns: 1fr;
  }

  body.detail-page-active .detail-meta .meta-item:last-child {
    grid-column: auto;
  }

  body.human-interface-v2.detail-page-active .case-index-links {
    gap: 18px;
    scroll-snap-type: x proximity;
  }

  body.detail-page-active .case-index-group {
    scroll-snap-align: start;
  }
}

@media (max-width: 360px) {
  body.human-interface-v2.detail-page-active .case-index-links {
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
