@import url("https://fonts.googleapis.com/css2?family=Overpass:wght@400;700&display=swap");

:root {
  --clr-primary: hsl(25, 97%, 53%);
  --clr-white: hsl(0, 0%, 100%);
  --clr-lightGrey: hsl(217, 12%, 63%);
  --clr-mediumGrey: hsl(216, 12%, 54%);
  --clr-darkGrey: hsl(219, 14%, 19%);
  --clr-veryDarkBlue: hsl(216, 12%, 8%);
}

/* Modern Reset https://piccalil.li/blog/a-modern-css-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.6;
}

/* 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;
  }
}

/* End Reset */

body {
  background-color: var(--clr-veryDarkBlue);
  font-family: "Overpass", sans-serif;
}

/* Utility Classes */

.text-primary {
  color: var(--clr-primary);
}
.text-white {
  color: var(--clr-white);
}
.text-light-grey {
  color: var(--clr-lightGrey);
}

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

.flex {
  display: flex;
}

.space-between {
  justify-content: space-between;
}

.wrapper {
  width: 100%;
  height: 97vh;
  justify-content: center;
  align-items: center;
}

/* Components */
.rating-card {
  flex-direction: column;
  background: radial-gradient(
    circle at top,
    hsl(219, 23%, 19%) 0,
    var(--clr-veryDarkBlue) 110%
  );

  border-radius: 1.5rem;
  margin-inline: auto;
  padding: 2rem;
  width: min-content;
  min-width: 425px;
  min-height: 400px;
}

@media screen and (max-width: 440px) {
  .rating-card {
    min-width: 0px;
    width: 90%;
    padding: 1.125rem;
  }
}

.rating-card > * {
  flex-direction: column;
  height: auto;
}

.rating-card h1 + p {
  margin-top: 1rem;
}

#rating-state[aria-hidden="true"],
#thank-you-state[aria-hidden="true"] {
  display: none;
}

#rating-state {
  min-height: inherit;
}

#thank-you-state {
  align-items: center;
  padding: 2rem 1.5rem;
  width: 425px;
}

#thank-you-state img {
  width: auto;
}

.btn-primary {
  background-color: var(--clr-primary);
  color: var(--clr-white);
  text-transform: uppercase;
  border-radius: 25px;
  border: none;
  padding: 0.8rem 0;
  letter-spacing: 0.125rem;
}

.btn-primary:hover,
.btn-primary:focus {
  cursor: pointer;
  background-color: var(--clr-white);
  color: var(--clr-primary);
}

.round-container {
  background-color: var(--clr-darkGrey);
  height: 3.125rem;
  width: 3.125rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}

.rating-box .round-container:hover,
.round-container:focus {
  background-color: var(--clr-primary);
  color: var(--clr-white);
  cursor: pointer;
}

.round-container[aria-selected="true"] {
  background-color: var(--clr-lightGrey);
  color: var(--clr-white);
}

.rating-container {
  background: var(--clr-darkGrey);
  padding: 0.4rem 1.5rem;
  border-radius: 20px;
  margin: 2rem auto;
}

.attribution {
  font-size: 11px;
  text-align: center;
}
.attribution a {
  color: hsl(228, 45%, 44%);
}
