/* Responsive hardening for the home page. */
html,
body,
main,
.mast,
.footer,
section {
  max-width: 100%;
}

main :where(h1, h2, h3, p, a, span, strong, small, pre),
.mast :where(a, span, button),
.footer :where(a, span, b),
th,
td {
  overflow-wrap: anywhere;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

:where(
  .mast,
  .split,
  .section-top,
  .project-grid,
  .principle-grid,
  .notes-grid,
  .case-head,
  .bench-body,
  .feature-story,
  .more-stories,
  .stories-heading,
  .collab-intro,
  .collab-grid,
  .digest-output,
  .harness-layout,
  .outcome,
  .footer
) > * {
  min-width: 0;
}

.hero-inner h1,
.hero-inner h1 span,
.hero-inner h1 em {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.artifact pre {
  max-width: 100%;
}

@media (max-width: 900px) {
  .mast {
    gap: 18px;
  }

  .mast nav {
    gap: 18px;
  }

  .collab-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .split,
  .case-head,
  .feature-story,
  .stories-heading,
  .collab-intro,
  .harness-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .bench-body,
  .more-stories,
  .collab-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-grid,
  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .mast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 4.5%;
  }

  .wordmark {
    font-size: 22px;
  }

  .wordmark span {
    margin-left: 8px;
    padding-left: 8px;
    font-size: 14px;
  }

  .mast nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    font-size: 12px;
  }

  .mast nav a,
  .langs button,
  .digest-controls button,
  .btn,
  .collab-step summary,
  .collab-detail a {
    min-height: 40px;
  }

  .mast nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    text-align: center;
  }

  .langs {
    margin-left: 0;
  }

  .langs button {
    padding: 8px;
  }

  .home-hero {
    min-height: 0;
  }

  .hero-inner {
    padding: 56px 0;
  }

  .hero-inner h1 {
    font-size: clamp(30px, 10vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.025em;
  }

  .hero-inner h1 em {
    letter-spacing: -0.025em;
  }

  .project-grid,
  .principle-grid,
  .notes-grid,
  .feature-list,
  .bench-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .outcome {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .outcome > div:nth-child(2) {
    display: contents;
    min-width: 0;
  }

  .outcome-number {
    font-size: 44px;
  }

  .outcome strong,
  .outcome p {
    display: block;
  }

  .outcome p {
    margin-top: 0;
  }

  .digest-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .digest-controls button {
    width: 100%;
    text-align: left;
  }

  .collab-step summary {
    padding: 12px 14px;
  }

  .collab-detail {
    padding-right: 14px;
    padding-left: 14px;
  }

  .collab-detail a {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    text-align: center;
  }

  .visual-top,
  .visual-bottom,
  .small-meta,
  .panel-top,
  .artifact-head {
    flex-wrap: wrap;
  }
}
