/* ------------------- */
/* Custom properties   */
/* ------------------- */
:root {
  --clr-magenta-700: 300 43% 22%;
  --clr-pink-300: 333, 80%, 67%;
  --clr-neutral-100: 0 0% 100%;
  --clr-neutral-200: 300 24% 96%;
  --clr-neutral-300: 303 10% 53%;

  --ff-sans: "League Spartan", sans-serif;

  --fs-400: 0.8125rem;
  --fs-500: 0.9375rem;
  --fs-900: 2rem;

  --fw-400: 400;
  --fw-500: 500;
  --fw-700: 700;
}

@media (min-width: 50em) {
  :root {
    --fs-900: 3rem;
  }
}

/* ------------------- */
/* Reset               */
/* ------------------- */

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

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 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 root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.67;
  font-family: var(--ff-sans);
  font-size: var(--fs-400);
  font-weight: var(--fw-400);
  color: hsl(var(--clr-magenta-700));
}

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

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

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

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

h1 {
  line-height: 1;
}

/* ------------------- */
/* Composition         */
/* ------------------- */
.flex {
  display: flex;
  gap: var(--flex-gap, 1rem);
}

.grid {
  display: grid;
  gap: var(--grid-gap, 1rem);
}

.space-y > *:where(:not(:first-child)) {
  margin-top: var(--space, 1rem);
}

/* ------------------- */
/* Utility             */
/* ------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bg-magenta-700 {
  background-color: hsl(var(--clr-magenta-700));
}
.bg-neutral-200 {
  background-color: hsl(var(--clr-neutral-200));
}

.text-magenta-700 {
  color: hsl(var(--clr-magenta-700));
}
.text-pink-300 {
  color: hsl(var(--clr-pink-300));
}
.text-neutral-100 {
  color: hsl(var(--clr-neutral-100));
}
.text-neutral-300 {
  color: hsl(var(--clr-neutral-300));
}

.fs-400 {
  font-size: var(--fs-400);
}
.fs-500 {
  font-size: var(--fs-500);
}
.fs-900 {
  font-size: var(--fs-900);
}

.fw-500 {
  font-weight: var(--fw-500);
}
.fw-700 {
  font-weight: var(--fw-700);
}

.text-center {
  text-align: center;
}

@media (min-width: 50em) {
  .md-text-start {
    text-align: start;
  }
}

/* ------------------- */
/* Block               */
/* ------------------- */
.container {
  place-content: center;
  grid-template-rows: 1fr auto 1fr;
  grid-template-areas:
    "header"
    "main"
    "footer";
  min-height: 100vh;
  min-width: fit-content;
  padding: 1rem 1.5rem;
  background-image: url(/assets/bg-pattern-top-mobile.svg),
    url(/assets/bg-pattern-bottom-mobile.svg);
  background-position: top left, bottom right;
  background-repeat: no-repeat;
}

.container > .content-layout {
  grid-area: main;
  --grid-gap: 3rem;
  max-width: 69.375rem;
}

.container > footer {
  grid-area: footer;
  align-self: end;
}

.intro > h1 {
  letter-spacing: -1.14px;
  max-width: 12ch;
  margin-inline: auto;
}

.intro > p {
  letter-spacing: -0.5px;
  max-width: 35ch;
  margin-top: 1.125rem;
}

.ratings > .rating {
  flex-direction: column;
  border-radius: 8px;
  padding: 1rem;
  max-width: 20.4375rem;
  margin-inline: auto;
}

.ratings > .rating .stars {
  --flex-gap: 0.5rem;
  justify-content: center;
}

.ratings > .rating p {
  line-height: 1.12;
}

.testimonials {
  flex-direction: column;
}

.testimonials > .testimonial {
  --grid-gap: 1.5rem;
  grid-template-columns: auto 1fr;
  align-items: center;
  border-radius: 8px;
  padding: 2.5rem 2rem;
  max-width: 20.4375rem;
  margin-inline: auto;
}

.testimonials > .testimonial > img {
  grid-column: 1 / 2;
  border-radius: 50%;
  aspect-ratio: 1;
  width: 2.5rem;
}

.testimonials > .testimonial > header {
  grid-column: 2 / 3;
}

.testimonials > .testimonial > p {
  grid-column: 1 / -1;
  letter-spacing: -0.23px;
}

@media (min-width: 50em) {
  .container {
    background-image: url(/assets/bg-pattern-top-desktop.svg),
      url(/assets/bg-pattern-bottom-desktop.svg);
  }

  .container > .content-layout {
    --grid-gap: 4.5rem;
    grid-template-columns: 1fr 1fr;
  }

  .intro {
    grid-column: 1 / 2;
  }

  .intro > h1 {
    letter-spacing: -1.71px;
    margin-inline: unset;
  }

  .ratings {
    grid-column: 2 / 3;
    align-self: center;
  }

  .ratings > .rating {
    --flex-gap: 2rem;
    flex-direction: row;
    align-items: center;
    max-width: 27.8125rem;
    padding: 1.25rem 2rem;
  }

  .ratings > .rating:first-of-type {
    margin-inline: 0 auto;
  }

  .ratings > .rating:last-of-type {
    margin-inline: auto 0;
  }

  .testimonials {
    grid-column: 1 / -1;
    --flex-gap: 1.875rem;
    flex-direction: row;
  }

  .testimonials > .testimonial {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 21.875rem;
  }

  .testimonials > .testimonial:nth-child(1) {
    margin-block: 0 2rem;
  }

  .testimonials > .testimonial:nth-child(2) {
    margin-block: 1rem;
  }

  .testimonials > .testimonial:nth-child(3) {
    margin-block: 2rem 0;
  }
}
