/* Begin of CSS reset, credits: https://www.joshwcomeau.com/css/custom-css-reset/ */

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Increase line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/* End of CSS reset */


/* General Rules */
:root {
  --color-red: hsl(0, 78%, 62%);
  --color-cyan: hsl(180, 62%, 55%);
  --color-orange: hsl(34, 97%, 64%);
  --color-blue: hsl(212, 86%, 64%);

  --color-grey-500: hsl(234, 12%, 34%);
  --color-grey-400: hsl(212, 6%, 44%);
  --color-white: hsl(0, 0%, 98%);

  --font-family: "Poppins", sans-serif;
  --font-size-body: 0.9375rem;

  --font-weight-light: 200;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--color-white);
  padding: clamp(1rem, 5vw, 2rem);
  font-size: var(--font-size-body);
  font-family: var(--font-family);
}

/* Header Styling */

header {
  max-width: 33.75rem;
  text-align: center;
  margin-bottom: 4rem;
  color: var(--color-grey-500);
}

header h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  white-space: nowrap;
  font-weight: var(--font-weight-light);
  letter-spacing: 0.25px;
  line-height: 1.4;
  margin-bottom: 1rem;
}

header h1 span {
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.25px;
  line-height: 1.4;
}

header p {
  font-size: 0.9375rem;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0;
  line-height: 1.4;
}

/* Main body styling */

main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  place-content: center;
  align-items: center;
}


/* Card Styling */

.card {
  width: 100%;
  max-width: 21.875rem;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 2rem;
  box-shadow: 0 15px 30px -11px #83A6D2;
  border-radius: 8px;
  border-top: 4px solid;
}

.card h2 {
  color: var(--color-grey-500);
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  line-height: 1.35;
  margin-bottom: 0.375rem;
}

.card p {
  color: var(--color-grey-400);
  font-size: 0.8125rem;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0;
  line-height: 1.6;
}

.card img {
  aspect-ratio: 1 / 1;
  max-width: 4rem;
  align-self: flex-end;
}

/* Individual Cards Styling */

.cyan {
  border-color: var(--color-cyan);
  grid-row: span 2;
}

.red {
  border-color: var(--color-red);
}

.orange {
  border-color: var(--color-orange);
}

.blue {
  border-color: var(--color-blue);
  grid-row: 1 / 3;
  grid-column: 3;
}

/* Media Queries */

/* Tablet 768px */
@media (max-width: 48rem) {
  main {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }


  .cyan {
    grid-row: 2;
    grid-column: 1;
  }

  .red {
    grid-row: 1;
    grid-column: 1 / 3;
    justify-self: center;
  }

  .orange {
    grid-row: 2;
    grid-column: 2;
  }

  .blue {
    grid-row: 3;
    grid-column: 1 / 3;
    justify-self: center;
  }
}

/* Mobile 440px */
@media (max-width: 27.5rem) {
  main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
}