/* Mobile content rhythm for public directory pages.
 * Scoped by .content-density-page; site-home and tool applications are excluded.
 * Keep text, links and page SEO intact; only reduce redundant whitespace.
 */
@media (max-width: 760px) {
  .content-density-page:not(.projects-effects) main {
    padding-block: 10px 38px;
  }
  .content-density-page:not(.projects-effects) .section {
    padding-block: 28px;
  }
  .content-density-page:not(.projects-effects) .section-head {
    gap: 9px;
    margin-bottom: 16px;
  }
  .content-density-page:not(.projects-effects) .section h2 {
    font-size: clamp(1.5rem, 6vw, 2.1rem);
    line-height: 1.23;
  }
  .content-density-page:not(.projects-effects) .section-desc {
    font-size: .91rem;
    line-height: 1.68;
  }
  .content-density-page:not(.projects-effects) .grid,
  .content-density-page:not(.projects-effects) .grid.two {
    gap: 11px;
  }
  .content-density-page:not(.projects-effects) .card {
    min-height: 0;
    padding: 17px 18px;
    border-radius: 16px;
  }
  .content-density-page:not(.projects-effects) .card-kicker {
    margin-bottom: 9px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: .72rem;
    line-height: 1.3;
    letter-spacing: .025em;
    box-shadow: none;
  }
  .content-density-page:not(.projects-effects) .card h3 {
    margin-bottom: 6px;
    font-size: clamp(1.07rem, 3.9vw, 1.24rem);
    line-height: 1.36;
  }
  .content-density-page:not(.projects-effects) .card p {
    font-size: .91rem;
    line-height: 1.66;
    overflow-wrap: break-word;
  }
  .content-density-page:not(.projects-effects) .card-link {
    min-height: 44px;
    align-items: center;
    margin-top: 9px;
    font-size: .87rem;
  }
  .content-density-page:not(.projects-effects) .note-panel {
    gap: 12px;
    margin-top: 12px;
    padding: 17px 18px;
    border-radius: 16px;
  }
  .content-density-page:not(.projects-effects) .note-panel .card-kicker {
    margin-bottom: 8px;
  }
  .content-density-page:not(.projects-effects) .note-panel strong {
    font-size: 1.05rem;
  }
  .content-density-page:not(.projects-effects) .note-panel p {
    font-size: .9rem;
    line-height: 1.65;
  }

  /* A short, readable footer. Keep all links at comfortable tap height. */
  .content-density-page .footer-inner {
    min-height: 0;
    gap: 7px 16px;
    padding-block: 17px 20px;
    align-items: flex-start;
  }
  .content-density-page .footer-identity {
    gap: 2px;
  }
  .content-density-page .footer-links {
    gap: 0 16px;
    align-items: center;
  }
  .content-density-page .footer-links a {
    min-height: 44px;
    font-size: .82rem;
  }
  .content-density-page .footer-inner > span,
  .content-density-page .footer-identity > span {
    font-size: .8rem;
    line-height: 1.5;
  }

  /* Japanese Profile: background and work-style cards stay complete, not giant. */
  .content-density-page.profile-page .section:first-child {
    padding-top: 20px;
  }
  .content-density-page.profile-page .card p {
    line-height: 1.68;
  }
  .content-density-page.profile-page .ja-cta {
    gap: 12px;
    padding: 17px 18px;
  }
  .content-density-page.profile-page .ja-cta .button {
    min-height: 46px;
    margin: 0;
  }

  /* A dedicated gallery page: reduce distance between showcases, not screenshots. */
  .content-density-page.projects-effects .project-v3-section {
    padding-block: 38px !important;
  }
  .content-density-page.projects-effects .project-v3-card-copy {
    padding: 17px 14px 16px;
  }
  .content-density-page.projects-effects .project-v3-card-top {
    margin-bottom: 11px;
  }
  .content-density-page.projects-effects .project-v3-specs {
    margin-top: 12px !important;
    margin-bottom: 15px !important;
  }
  .content-density-page.projects-effects .project-v3-lab {
    padding-block: 40px !important;
  }
  .content-density-page.projects-effects .project-v3-lab-card {
    gap: 16px;
    padding: 14px;
  }
  .content-density-page.projects-effects .section:not(.project-v3-section):not(.project-v3-lab) {
    padding-block: 30px;
  }

  /* Tools directory: keep two-column favorites and remove empty vertical stretch. */
  .content-density-page .tools-dashboard-main {
    padding-block: 4px 34px;
  }
  .content-density-page .tools-dashboard-main .section {
    padding-block: 26px;
  }
  .content-density-page .dashboard-card {
    min-height: 122px;
    gap: 10px;
    padding: 13px;
  }
  .content-density-page .dashboard-row {
    min-height: 64px;
  }
}
@media (max-width: 380px) {
  .content-density-page:not(.projects-effects) .card {
    padding-inline: 15px;
  }
  .content-density-page:not(.projects-effects) .grid {
    gap: 9px;
  }
  .content-density-page .footer-links {
    gap: 0 10px;
  }
}
@media (hover: none) {
  .content-density-page .card:hover,
  .content-density-page .note-panel:hover {
    transform: none;
  }
}
