/* CSS reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

#root,
#__next {
  isolation: isolate;
}

/* variables */

:root {
  /*  Primary Colors */

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

  /* Neutral Colors */

  --neutral-500: hsl(234, 12%, 34%);
  --neutral-400: hsl(212, 6%, 44%);
  --neutral-100: hsl(0, 0%, 100%);

  /* font stuff */

  --ff-base: "Poppins", sans-serif;

  --fw-light: 200;
  --fw-regular: 400;
  --fw-bold: 600;
}
/* base styling */
html {
  font-size: 15px;
}
body {
  min-height: 100vh;
  display: grid;
  place-content: center;
  font-family: var(--ff-base);
  font-weight: var(--fw-regular);
  color: var(--neutral-400);
  background-color: var(--neutral-100);
}
h1,
h2 {
  font-weight: var(--fw-bold);
  color: var(--neutral-500);
}
h2 {
  font-size: 1.5rem;
}
.card-header p {
  margin-top: 0.5rem;
  font-size: clamp(0.75rem, 0.571rem + 0.476vw, 1rem);
}

/*  layout styling */
.page-wrapper {
  max-width: 450px;
  display: grid;
  gap: 3rem;
  margin: 2rem 1rem;
}
/* component styling */
.page-header {
  max-width: 700px;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.title {
  font-size: clamp(1.4rem, 0.436rem + 2.571vw, 2.75rem);
  line-height: 1.3;
}
.title .title-intro {
  display: block;
  font-weight: var(--fw-light);
}

.description {
  font-size: clamp(0.9rem, 0.471rem + 1.143vw, 1.5rem);
  color: var(--neutral-500);
}
/* cards container */

.feature-cards {
  display: grid;
  gap: 2rem;
}

/* card */
.feature-card {
  position: relative;
  border-radius: 0.5em;
  box-shadow: 1px 6px 12px 0px rgba(0, 0, 0, 0.2);
  transition: transform 0.5s ease;
  border-top: 6px solid var(--primary-cyan);
}
.feature-card:hover {
  transform: translateY(-3px);
}

/* styling of bar at the top of each card */

.feature-card:nth-child(2) {
  border-top: 6px solid var(--primary-red);
  }
.feature-card:nth-child(3) {
  border-top:  6px solid var(--primary-orange);
}
.feature-card:nth-child(4) {
  border-top: 6px solid var(--primary-blue);
}
.card-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 2em 1.2em;
}

.card-icon {
  align-self: flex-end;
}
/* footer */
footer {
  text-align: center;
}

.attribution a {
  font-size: 1.2rem;
  font-weight: var(--fw-bold);
  background: linear-gradient(90deg, hsl(0, 78%, 62%), hsl(34, 97%, 64%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* media queries  */
@media (min-width: 43em) {
  .page-wrapper {
    max-width: 1150px;
  }
  .feature-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 60em) {
  .feature-cards {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(100px, auto);
  }
  /* cards postioning */

  .feature-card:nth-child(1) {
    grid-row: 2 / span 2;
  }
  .feature-card:nth-child(2) {
    grid-row: span 2;
  }

  .feature-card:nth-child(3) {
    grid-column-start: 2;
    grid-row: 3 / span 2;
  }
  .feature-card:nth-child(4) {
    grid-row: 2 / span 2;
  }
}
