@import url("https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  /* Primary */
  --purple-50: hsl(260, 100%, 95%);
  --purple-300: hsl(264, 82%, 80%);
  --purple-500: hsl(263, 55%, 52%);

  /* Neutral */
  --white: hsl(0, 0%, 100%);
  --grey-100: hsl(214, 17%, 92%);
  --grey-100-70: hsl(214, 17%, 95%, 0.7);
  --grey-200: hsl(0, 0%, 81%);
  --grey-400: hsl(224, 10%, 45%);
  --grey-400-25: hsl(224, 10%, 45%, 0.25);
  --grey-500: hsl(217, 19%, 35%);
  --dark-blue: hsl(219, 29%, 14%);
  --black: hsl(0, 0%, 7%);
}

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  min-height: 100vh;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core body defaults */
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--grey-100-70);
  min-height: 100vh;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* Style */

main {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 500;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  margin: 0 auto;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
  box-shadow: 4rem 4rem 2.5rem var(--grey-400-25);
}

.card h1 {
  font-size: 1.21875rem;
  font-weight: 600;
  line-height: 1.2;
}

.card p:last-of-type {
  line-height: 1.4;
  opacity: 0.9;
}

/* Card 1 */
.card:nth-of-type(1) {
  background-color: var(--purple-500);
  color: var(--purple-50);
}

/* Card 2 */
.card:nth-of-type(2) {
  background-color: var(--grey-500);
  color: var(--grey-100);
}

/* Card 3, 5 */
.card:nth-of-type(3),
.card:nth-of-type(5) {
  background-color: var(--white);
  color: var(--grey-500);
}

/* Card 4 */
.card:nth-of-type(4) {
  background-color: var(--dark-blue);
  color: var(--grey-200);
}

.user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user div p:last-of-type {
  font-size: 0.6875rem;
  margin-top: 0.1rem;
}

.user img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 0.125rem solid transparent;
}

.user p:nth-of-type(1) {
  font-weight: 500;
}

.card:nth-of-type(1) .user img {
  border-color: var(--purple-300);
}

.card:nth-of-type(4) .user img {
  border-color: var(--purple-500);
}

@media (min-width: 36em) {
  main {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "card1 card1"
      "card2 card3"
      "card4 card4"
      "card5 card5";
    grid-auto-rows: auto;
    row-gap: 1.5rem;
    column-gap: 2rem;
  }

  .card:nth-of-type(1) {
    grid-area: card1;
    background-image: url("./images/bg-pattern-quotation.svg");
    background-position: right 3.75rem top 0;
    background-repeat: no-repeat;
  }

  .card:nth-of-type(2) {
    grid-area: card2;
  }

  .card:nth-of-type(3) {
    grid-area: card3;
  }

  .card:nth-of-type(4) {
    grid-area: card4;
  }

  .card:nth-of-type(5) {
    grid-area: card5;
  }
}

@media (min-width: 54em) {
  main {
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
      "card1 card1 card2"
      "card3 card4 card4"
      "card5 card5 card5";
    grid-auto-rows: auto;
    max-width: 73rem;
  }
}

@media (min-width: 68em) {
  main {
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas:
      "card1 card1 card2 card5"
      "card3 card4 card4 card5";
    grid-auto-rows: auto;
  }
}
