/* Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins: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');

/* CSS Variables */
:root {
  /* Colors */
  --Red: hsl(0, 78%, 62%);
  --Cyan: hsl(180, 62%, 55%);
  --Orange: hsl(34, 97%, 64%);
  --Blue: hsl(212, 86%, 64%);
  --Grey500: hsl(234, 12%, 34%);
  --Grey400: hsl(212, 6%, 44%);
  --White: hsl(0, 0%, 100%);

  /* Font Family */
  --font-sans: 'Poppins', sans-serif;
}

/* CSS Reset */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Main Style */
body {
  background-color: var(--White);
  font-family: var(--font-sans);
  max-height: 100vh;
  padding: 40px 20px;
}

main {
  max-width: 1200px;
  margin: 0 auto;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--Grey500);
  margin-top: -20px;
  margin-bottom: 30px;
}

.header h1 {
  font-weight: 200;
}

.header h2 {
  font-size: 2rem;
  font-weight: 600;
}

.header p {
  max-width: 500px;
  line-height: 1.6;
}

.cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto 20px auto;
}

.card:nth-child(1) {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
}

.card:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.card:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.card:nth-child(4) {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
}

.card {
  background: var(--White);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 3px solid;
}

.card:nth-child(1) {
  border-top-color: var(--Cyan);
}
.card:nth-child(2) {
  border-top-color: var(--Red);
}
.card:nth-child(3) {
  border-top-color: var(--Orange);
}
.card:nth-child(4) {
  border-top-color: var(--Blue);
}

.card h3 {
  font-size: 14px;
  color: var(--Grey500);
  margin-bottom: 15px;
  font-weight: 600;
}

.card p {
  color: var(--Grey400);
  line-height: 1.6;
  font-size: 12px;
  margin-bottom: 25px;
}

.icon-container {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.icon-container img {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attribution {
  font-size: 11px;
  text-align: center;
}

.attribution a {
  color: hsl(228, 45%, 44%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header h1,
  .header h2 {
    font-size: 1.8rem;
  }

  .header p {
    font-size: 1rem;
  }

  .cards-container {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    gap: 25px;
    padding: 0 10px;
  }

  .card:nth-child(1),
  .card:nth-child(2),
  .card:nth-child(3),
  .card:nth-child(4) {
    grid-column: 1;
    grid-row: auto;
    align-self: stretch;
  }

  .card {
    padding: 25px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 20px 15px;
  }

  .header {
    margin-bottom: 50px;
  }

  .header h1,
  .header h2 {
    font-size: 1.5rem;
  }

  .card {
    padding: 20px;
  }

  .card h3 {
    font-size: 1.2rem;
  }

  .card p {
    font-size: 0.9rem;
  }
}
