/* Layer: utilities */
@media (prefers-reduced-motion: reduce) {
  .hero-home,
  .hero-console,
  .card,
  .button {
    transition: none !important;
    animation: none !important;
  }

  .hero-home::before {
    background:
      radial-gradient(circle at 78% 26%, rgba(200, 184, 141, 0.28), transparent 24%),
      linear-gradient(180deg, rgba(3, 6, 11, 0.78), rgba(3, 6, 11, 0.98));
  }
}

@media (max-width: 1240px) {
  .hero-grid,
  .collection-shell-header,
  .archive-header,
  .tool-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy-column h1 {
    max-width: 12ch;
  }

  .section-trust-contribute .trust-contribute-grid,
  .page-shell-grid,
  .collection-spotlight {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .site-header-inner {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #primary-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 32px;
    right: 32px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid rgba(173, 178, 182, 0.14);
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
      linear-gradient(180deg, rgba(42, 42, 48, 0.96), rgba(11, 13, 19, 0.98));
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.22);
  }

  #primary-menu.is-open {
    display: flex;
  }

  .header-nav-link {
    justify-content: flex-start;
    width: 100%;
  }

  .directory-shell {
    grid-template-columns: 1fr;
  }

  .filters,
  .directory-filters {
    position: static;
  }

  .hero-console-body,
  .tool-hero-intel,
  .tool-section-grid,
  .tool-related-grid,
  .tool-disclosure-grid,
  .article-proof-grid {
    grid-template-columns: 1fr;
  }

  .home-path-grid,
  .home-feature-grid,
  .home-collection-grid,
  .footer-grid,
  .collection-picks-grid,
  .archive-newsletter-panel,
  .footer-newsletter {
    grid-template-columns: 1fr;
  }

  .home-path-grid {
    grid-template-areas:
      "primary"
      "secondary-a"
      "secondary-b";
  }

  .featured-tool-card.is-emphasis,
  .collection-card.is-emphasis {
    grid-row: auto;
  }
}

@media (max-width: 920px) {
  .header-search {
    display: none;
  }

  .container {
    padding-inline: 24px;
  }

    #primary-menu {
      left: 24px;
      right: 24px;
    }

  .newsletter-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 38px 0;
  }

  .site-header-inner {
    min-height: 78px;
    gap: 12px;
  }

  .site-brand-logo {
    height: 28px;
    max-width: min(220px, 48vw);
  }

  .header-submit-cta {
    min-width: 0;
    padding-inline: 14px;
  }

  .hero-home {
    padding-top: 56px;
  }

  .hero-console-query {
    display: grid;
  }

  .hero-copy-column h1 {
    max-width: none;
    font-size: clamp(2.7rem, 13vw, 4.3rem);
  }

  .hero-actions,
  .article-footer,
  .comparison-empty-actions,
  .tool-hero-actions,
  .tool-card-footer,
  .article-card-footer,
  .collection-card-footer,
  .collection-tool-card-actions,
  .section-inline-actions {
    display: grid;
  }

  .hero-actions .button,
  .article-footer .button,
  .comparison-empty-actions .button,
  .tool-hero-actions .button,
  .tool-card-footer .button,
  .article-card-footer .button,
  .collection-card-footer .button,
  .collection-tool-card-actions .button,
  .section-inline-actions .button {
    width: 100%;
  }

  .quick-search {
    grid-template-columns: 1fr;
  }

  .card,
  .article-shell,
  .collection-shell,
  .page-shell,
  .archive-header,
  .archive-empty-state,
  .archive-intel-panels,
  .archive-newsletter-panel,
  .footer-newsletter,
  .hero-console {
    padding: 22px;
  }

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

  .tool-jump-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .container {
    padding-inline: 18px;
  }

    #primary-menu {
      left: 18px;
      right: 18px;
    }

  .site-header-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    min-height: 70px;
  }

  .site-brand {
    min-width: 0;
  }

  .site-brand-logo {
    height: 28px;
    max-width: min(170px, 44vw);
  }

  .nav-toggle {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .header-right {
    justify-content: flex-end;
  }

  .header-submit-cta {
    min-height: 44px;
    min-width: 0;
    padding-inline: 11px;
    border-radius: 12px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .site-footer-shell {
    gap: 24px;
  }

  .footer-brand {
    gap: 12px;
  }

  .footer-brand-logo {
    width: min(100%, 240px);
  }

  .footer-grid {
    gap: 20px;
  }

  .footer-newsletter {
    padding: 20px;
  }

  .tool-jump-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .site-header-inner {
    gap: 8px;
  }

  .site-brand-logo {
    height: 26px;
    max-width: min(150px, 40vw);
  }

  .nav-toggle {
    padding-inline: 10px;
    font-size: 0.78rem;
  }

  .header-submit-cta {
    padding-inline: 10px;
    font-size: 0.76rem;
  }

  .header-submit-label-full {
    display: none;
  }

  .header-submit-label-short {
    display: inline;
  }
}
