:root {
  --color-text: #6c727f;
  --color-heading: #000;
  --color-background: #f3f4f6;
  --color-shadow: #d9d9da;
  --font-base: "Be Vietnam Pro", sans-serif;
  --spacing-base: clamp(1rem, 2vw, 1.5rem);
  --spacing-large: clamp(1.5rem, 3vw, 2.5rem);
  --card-radius: 20px;
  --container-max: 1440px;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-base);
  font-size: clamp(14px, 1vw + 13px, 16px);
  color: var(--color-text);
  font-weight: 400;
  text-align: center;
}

/* Layout */
main {
  display: inline-block;
  margin: 0 auto;
  text-align: left;
  width: 100%;
}

.container {
  max-width: var(--container-max);
  margin: var(--spacing-large) auto;
  padding-inline: var(--spacing-base);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header styles */
header {
  margin-bottom: var(--spacing-large);
  text-align: center;
  max-width: 612px;
}

header img {
  width: clamp(24px, 4vw, 32px);
  height: auto;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--color-heading);
  margin-block: clamp(0.75rem, 2vw, 1rem);
}

/* Grid layout */
.grid {
  width: 100%;
  background-color: var(--color-background);
  padding: var(--spacing-base);
  border-radius: var(--card-radius);
  display: grid;
  gap: var(--spacing-base);
  justify-content: center;
  align-items: center;
}

/* Card styles */
.card {
  display: flex;
  box-shadow: 0 3px 2px 2px var(--color-shadow);
  border-radius: var(--card-radius);
  width: 100%;
  height: auto;
  padding: clamp(1.5rem, 4vw, 2rem);
  gap: clamp(0.75rem, 2vw, 1rem);
  background-color: white;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card img {
  max-width: min(275px, 100%);
  height: auto;
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: clamp(0.5rem, 2vw, 0.75rem);
}

/* Responsive layouts */
@media (max-width: 640px) {
  main {
    display: block;
  }

  .card {
    flex-direction: column;
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card:nth-child(1),
  .card:nth-child(2) {
    flex-direction: column;
    width: auto;
    height: 100%;
  }

  .card:nth-child(n + 3) {
    grid-column: span 2;
  }
}

@media (min-width: 1280px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .card:nth-child(1),
  .card:nth-child(2),
  .card:nth-child(3) {
    flex-direction: column;
    width: auto;
    height: 100%;
    grid-column: span 2;
  }

  .card:nth-child(n + 4) {
    grid-column: span 3;
  }
}
