/* Landing page layout.
 *
 * The vendored Primer is the old float grid: a fixed 900px
 * container and percentage columns that never collapse, which gave
 * this page one width it looked right at. It still provides the
 * typography and colours; the layout below is its own — a single
 * card grid that reflows from a phone to a desktop without a set of
 * breakpoints to keep in sync.
 */

body {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  color: #24292e;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- header ------------------------------------------------- */

.intro {
  text-align: center;
  margin-bottom: 1.5rem;
}

.intro h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 0 0.4rem;
  /* scales with the viewport instead of wrapping awkwardly */
  font-size: clamp(1.35rem, 5vw, 2rem);
  line-height: 1.2;
}

.intro .logo {
  width: clamp(32px, 8vw, 48px);
  height: auto;
  flex: none;
}

.intro .tagline {
  margin: 0 0 0.4rem;
  font-weight: 600;
  color: #444d56;
}

.intro .subline {
  margin: 0;
  color: #586069;
  font-size: 1rem;
}

/* ---- sections ----------------------------------------------- */

.sections {
  display: grid;
  /* two columns where they fit, one where they do not — the cards
     keep their size either way */
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
  align-items: start;
}

.section {
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 0.9rem 0.9rem 1rem;
  background: #ffffff;
}

.section h2 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  text-align: center;
}

.section .sectionlead {
  margin: 0 0 0.8rem;
  color: #586069;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

/* ---- cards -------------------------------------------------- */

.card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.card + .card {
  margin-top: 0.35rem;
}

.card:hover,
.card:focus-visible {
  background: #f6f8fa;
  border-color: #e1e4e8;
  text-decoration: none;
}

.cardicon {
  width: 48px;
  height: 48px;
  flex: none;
  object-fit: contain;
}

.cardtext {
  min-width: 0;
}

.cardtitle {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0366d6;
}

.carddesc {
  display: block;
  color: #586069;
  font-size: 0.9rem;
  line-height: 1.35;
}

/* ---- small screens ------------------------------------------ */

@media (max-width: 30rem) {
  body {
    padding: 1rem 0.75rem 1.5rem;
  }

  .intro {
    margin-bottom: 1rem;
  }

  .intro h1 {
    gap: 0.4rem;
  }

  .cardicon {
    width: 40px;
    height: 40px;
  }
}

/* Short viewports (browser chrome eating the fold): the entry
   points matter more than the intro line. */
@media (max-height: 620px) {
  .intro .subline {
    display: none;
  }

  .section .sectionlead {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
  }
}
