/* -------------------------------------------------- */
/* Reset                                               */
/* -------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button, input {
  font: inherit;
}

/* -------------------------------------------------- */
/* Custom properties                                   */
/* -------------------------------------------------- */
:root {
  --navy-850: hsl(217, 28%, 15%);
  --navy-900: hsl(218, 28%, 13%);
  --navy-950: hsl(216, 53%, 9%);
  --navy-800: hsl(219, 30%, 18%);

  --teal-200: hsl(176, 68%, 64%);
  --cyan-500: hsl(198, 60%, 50%);
  --red-500: hsl(0, 100%, 63%);

  --white: hsl(0, 0%, 100%);
  --white-70: hsla(0, 0%, 100%, 0.7);
  --white-15: hsla(0, 0%, 100%, 0.15);
  --grey-500: hsl(218, 15%, 55%);
  --shadow-color: hsla(0, 0%, 0%, 0.3);
  --shadow-color-strong: hsla(0, 0%, 0%, 0.45);

  --ff-heading: 'Raleway', sans-serif;
  --ff-body: 'Open Sans', sans-serif;
}

/* -------------------------------------------------- */
/* Base                                                */
/* -------------------------------------------------- */
body {
  background-color: var(--navy-900);
  color: var(--white-70);
  font-family: var(--ff-body);
  font-size: 0.9375rem;
  line-height: 1.6;
}

h1, h2 {
  font-family: var(--ff-heading);
  color: var(--white);
  font-weight: 700;
  line-height: 1.3;
}

.wrapper {
  max-width: 69.375rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--teal-200);
  outline-offset: 3px;
  border-radius: 2px;
}

/* -------------------------------------------------- */
/* Buttons & form fields                               */
/* -------------------------------------------------- */
.button {
  display: inline-block;
  border: none;
  border-radius: 100vw;
  padding: 0.85em 2em;
  background-color: var(--cyan-500);
  background-image: linear-gradient(90deg, var(--teal-200), var(--cyan-500));
  color: var(--white);
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.button:hover,
.button:focus-visible {
  opacity: 0.8;
}

.form__field {
  flex: 1;
}

.form__field input {
  width: 100%;
  border-radius: 100vw;
  border: 1px solid transparent;
  padding: 0.85em 1.5em;
  background-color: var(--white);
  color: var(--navy-900);
}

.form__field input::placeholder {
  color: var(--grey-500);
}

input.touched:invalid {
  border-color: var(--red-500);
}

.form__error {
  display: block;
  margin-block-start: 0.4rem;
  margin-inline-start: 1.5rem;
  font-size: 0.75rem;
  color: var(--red-500);
  font-style: italic;
}

/* -------------------------------------------------- */
/* Header                                              */
/* -------------------------------------------------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block-start: 2.5rem;
  padding-block-end: 2.5rem;
}

.header__logo img {
  height: 1.75rem;
}

.header__nav ul {
  display: flex;
  gap: 1.75rem;
}

.header__nav a {
  color: var(--white-70);
  font-size: 0.9rem;
  padding-block-end: 0.2rem;
  border-block-end: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.header__nav a:hover,
.header__nav a:focus-visible {
  color: var(--white);
  border-block-end-color: var(--white-70);
}

/* -------------------------------------------------- */
/* Hero                                                */
/* -------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  text-align: center;
  gap: 2rem;
  padding-block-start: 1rem;
  padding-block-end: 4rem;
}

.hero__illustration img {
  width: 100%;
  max-width: 30rem;
}

.hero__text h1 {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  margin-block-end: 1.25rem;
}

.hero__text p {
  margin-block-end: 1.75rem;
  max-width: 34rem;
  margin-inline: auto;
}

.hero__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 26rem;
  margin-inline: auto;
}

.curve-divider {
  height: 4.5rem;
  background-image: url('./images/bg-curvy-mobile.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: top center;
}

/* -------------------------------------------------- */
/* Features                                            */
/* -------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-block: 2rem 4rem;
}

.feature__icon {
  height: 3.25rem;
  margin-block-end: 1.5rem;
}

.feature h2 {
  font-size: 1.15rem;
  margin-block-end: 0.85rem;
}

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

/* -------------------------------------------------- */
/* Stay productive                                     */
/* -------------------------------------------------- */
.productive {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  padding-block: 2rem 5rem;
  text-align: center;
}

.productive__illustration img {
  width: 100%;
  max-width: 30rem;
}

.productive__text h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-block-end: 1.25rem;
  max-width: 24rem;
  margin-inline: auto;
}

.productive__text p {
  margin-block-end: 1.25rem;
  max-width: 32rem;
  margin-inline: auto;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--teal-200);
  border-block-end: 1px solid var(--teal-200);
  padding-block-end: 0.3rem;
  margin-block-start: 0.5rem;
  transition: opacity 0.2s ease;
}

.link-arrow:hover,
.link-arrow:focus-visible {
  opacity: 0.7;
}

/* -------------------------------------------------- */
/* Testimonials                                        */
/* -------------------------------------------------- */
.testimonials {
  padding-block: 1rem 5rem;
}

.testimonials__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.testimonial {
  background-color: var(--navy-800);
  border-radius: 0.5rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 1.25rem 1.5rem -1rem var(--shadow-color);
}

.testimonial__quote-icon {
  height: 1.4rem;
  margin-block-end: 1rem;
}

.testimonial > p {
  font-size: 0.85rem;
  margin-block-end: 1.5rem;
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial__author img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial__name {
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
}

.testimonial__role {
  font-size: 0.75rem;
}

/* -------------------------------------------------- */
/* CTA                                                 */
/* -------------------------------------------------- */
.cta {
  padding-block: 5rem;
}

.cta__inner {
  background-color: var(--navy-850);
  border-radius: 0.5rem;
  padding: 3rem 1.75rem;
  text-align: center;
  max-width: 40rem;
  box-shadow: 0 1.5rem 2.5rem -1rem var(--shadow-color-strong);
}

.cta__inner h2 {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  margin-block-end: 1rem;
}

.cta__inner p {
  margin-block-end: 2rem;
}

.cta__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* -------------------------------------------------- */
/* Footer                                              */
/* -------------------------------------------------- */
.footer {
  background-color: var(--navy-950);
  padding-block: 3.5rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.footer__logo {
  height: 2.25rem;
  filter: brightness(0) saturate(100%) invert(56%) sepia(89%) saturate(300%) hue-rotate(120deg);
}

.footer__contact p {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  margin-block-end: 1.1rem;
  font-size: 0.9rem;
}

.footer__contact img {
  flex-shrink: 0;
  margin-block-start: 0.2rem;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer__links ul {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer__links a {
  transition: color 0.2s ease;
}

.footer__links a:hover,
.footer__links a:focus-visible {
  color: var(--teal-200);
}

.footer__social {
  display: flex;
  gap: 1rem;
}

.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--white-15);
  border-radius: 50%;
  color: var(--white);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.footer__social svg {
  fill: currentColor;
  width: 1rem;
  height: 1rem;
}

.footer__social a:hover,
.footer__social a:focus-visible {
  background-color: var(--teal-200);
  border-color: var(--teal-200);
  color: var(--navy-950);
}

/* -------------------------------------------------- */
/* Attribution                                         */
/* -------------------------------------------------- */
.attribution {
  font-size: 0.6875rem;
  text-align: center;
  padding: 1.25rem 1rem;
  background-color: var(--navy-950);
  color: var(--white-70);
}

.attribution a {
  color: var(--teal-200);
  text-decoration: underline;
}

/* -------------------------------------------------- */
/* Reduced motion                                      */
/* -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .button,
  .header__nav a,
  .link-arrow,
  .footer__links a,
  .footer__social a {
    transition: none;
  }
}

/* -------------------------------------------------- */
/* Tablet / Desktop                                     */
/* -------------------------------------------------- */
@media (min-width: 44rem) {
  .header {
    padding-block-start: 3.5rem;
  }

  .hero {
    flex-direction: row;
    text-align: start;
    gap: 4rem;
    padding-block-start: 3rem;
    padding-block-end: 6rem;
  }

  .hero__text,
  .hero__illustration {
    flex: 1;
  }

  .hero__text p,
  .hero__form {
    margin-inline: 0;
  }

  .hero__form {
    flex-direction: row;
    max-width: none;
  }

  .curve-divider {
    height: 8rem;
    background-image: url('./images/bg-curvy-desktop.svg');
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 3rem;
    row-gap: 3rem;
    padding-block: 3rem 6rem;
  }

  .productive {
    flex-direction: row;
    text-align: start;
    gap: 5rem;
    padding-block: 3rem 7rem;
  }

  .productive__illustration,
  .productive__text {
    flex: 1;
  }

  .productive__text h2,
  .productive__text p {
    margin-inline: 0;
  }

  .testimonials {
    padding-block: 2rem 7rem;
  }

  .testimonials__list {
    grid-template-columns: repeat(3, 1fr);
  }

  .testimonial:nth-child(2) {
    transform: translateY(1rem);
  }

  .cta__form {
    flex-direction: row;
  }

  .footer {
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 3rem;
    padding-block: 4.5rem;
  }

  .footer__logo {
    grid-row: 1 / 3;
  }

  .footer__links {
    flex-direction: row;
    gap: 5rem;
  }

  .footer__social {
    align-self: end;
  }
}

@media (min-width: 64rem) {
  .footer {
    grid-template-columns: auto 1fr auto auto;
  }

  .footer__social {
    align-self: center;
  }
}
