@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* https://kilianvalkhof.com/2022/css-html/your-css-reset-needs-text-size-adjust-probably/ */
  html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }

  body,
  h1,
  h2,
  h3,
  h4,
  p,
  figure,
  blockquote,
  dl,
  dd {
    margin: 0;
  }

  /* https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html */
  [role="list"] {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  body {
    min-block-size: 100vh;
    line-height: 1.6;
    font-size: 15px;
  }

  h1,
  h2,
  h3,
  button,
  input,
  label {
    line-height: 1.1;
  }

  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }

  p,
  li {
    text-wrap: pretty;
  }

  img,
  picture {
    max-inline-size: 100%;
    display: block;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
  }
}

@layer base {
  .poppins-extralight {
    font-family: "Poppins", sans-serif;
    font-weight: 200;
    font-style: normal;
  }

  .poppins-regular {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-style: normal;
  }

  .poppins-semibold {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-style: normal;
  }

  :root {
    /* primary colors */

    --red: hsl(0, 78%, 62%);
    --cyan: hsl(180, 62%, 55%);
    --orange: hsl(34, 97%, 64%);
    --blue: hsl(212, 86%, 64%);

    /* neutral colors */
    --grey-500: hsl(234, 12%, 34%);
    --grey-400: hsl(212, 6%, 44%);
    --white: hsl(0, 0%, 100%);

    /* font family */
    --ff-poppins: "Poppins", sans-serif;

    /* Font sizes */
    --fs-main: 0.938rem; /* 15px */
    --fs-heading: 1.25rem; /* 20px */
    --fs-heading-lg: 1.5rem; /* 24px */
  }

  body {
    font-family: var(--ff-poppins);
    color: var(--grey-500);
    font-size: var(--fs-main);
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    background-color: var(--white);
    padding: 5em;
  }

  h1 {
    font-size: var(--fs-heading);
    font-weight: 200;
  }

  h2 {
    font-size: var(--fs-heading-lg);
    font-weight: 600;
  }

  h3 {
    font-size: var(--fs-heading);
    font-weight: 600;
  }

  .attribution {
    font-size: 0.75em;
    text-align: center;
  }
  .attribution a {
    color: var(--blue);
  }

  .attribution a:hover {
    text-decoration: underline;
    color: var(--cyan);
  }
}

@layer layout {
  main {
    max-inline-size: 1000px;
    margin: 0 auto;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1em;
    gap: 0.5em;
    margin: 0 auto;
  }

  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    place-items: center;
    grid-template-areas:
      "card-1"
      "card-2"
      "card-3"
      "card-4";
    gap: 2em;
    margin: 1em 0;
  }

  .card {
    display: grid;
    grid-template-rows: auto auto;
    gap: 1em;
    background-color: var(--white);
    border-radius: 0.5em;
    padding: 1em;
    text-align: left;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px,
      rgba(0, 0, 0, 0.05) 0px 4px 6px -2px;
    transition: transform 0.3s ease;
    width: 100%;
  }

  .card h3,
  p {
    grid-column: span 2;
  }

  .card img {
    grid-column: 2;
    justify-self: end;
  }

  .card-1 {
    border-top: 3px solid var(--cyan);
    grid-area: card-1;
  }

  .card-2 {
    border-top: 3px solid var(--red);
    grid-area: card-2;
  }

  .card-3 {
    border-top: 3px solid var(--orange);
    grid-area: card-3;
  }

  .card-4 {
    border-top: 3px solid var(--blue);
    grid-area: card-4;
  }

  @media (min-width: 700px) {
    .cards {
      grid-template-columns: repeat(3, 1fr);
      grid-template-areas:
        ". card-2 ."
        "card-1 card-2 card-4"
        "card-1 card-3 card-4"
        ". card-3 .";
    }
  }
}
