/* ------------------- */
/* Custom properties   */
/* ------------------- */
:root {
  --clr-slate-200: 232 10% 56%;
  --clr-slate-400: 234 25% 52%;
  --clr-slate-600: 233 54% 16%;
  --clr-pink-200: 341 100% 83%;
  --clr-pink-400: 341 92% 62%;
  --clr-pink-600: 322 87% 55%;
  --clr-orange-400: 13 100% 64%;
  --clr-blue-400: 237 100% 64%;
  --clr-blue-600: 233 92% 29%;
  --clr-neutral-100: 0 0% 100%;
  --clr-neutral-200: 234 100% 97%;

  --lg-orange-to-pink: linear-gradient(
    180deg,
    hsl(var(--clr-orange-400)) 0%,
    hsl(var(--clr-pink-600)) 100%
  );
  --lg-blue-to-pink: linear-gradient(
    180deg,
    hsl(var(--clr-blue-400)) 0%,
    hsl(var(--clr-pink-600)) 100%
  );
  --lg-neutral: linear-gradient(
    0deg,
    hsl(var(--clr-neutral-100) / 0.5),
    hsl(var(--clr-neutral-100) / 0.5)
  );

  --ff-sans: "Plus Jakarta Sans", sans-serif;

  --fs-300: 0.875rem; /* 14 */
  --fs-400: 1rem; /* 16 */
  --fs-500: 1.125rem; /* 18 */
  --fs-600: 1.25rem; /* 20 */
  --fs-700: 1.5rem; /* 24 */
  --fs-800: 2rem; /* 32 */
  --fs-900: 2.5rem; /* 40 */

  --lh-300: 2;
  --lh-400: 1.625;
  --lh-500: 1.556;
  --lh-600: 1.26;
  --lh-700: 1.333;
  --lh-800: 1.26;
  --lh-900: 1.26;

  --fw-500: 500;
  --fw-700: 700;
  --fw-800: 800;
}

@media (min-width: 75em) {
  :root {
    --fs-300: 1rem;
    --fs-400: 1.125rem;
    --fs-600: 1.5rem;
    --fs-700: 2rem;
    --fs-800: 2.5rem;
    --fs-900: 3.5rem;

    --lh-300: 1.75;
    --lh-400: 1.556;
    --lh-600: 1.26;
    --lh-700: 1.25;
    --lh-800: 1.26;
    --lh-900: 1.26;
  }
}

/* ------------------- */
/* 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: var(--lh-400);
  font-family: var(--ff-sans);
  font-size: var(--fs-400);
  font-weight: var(--fw-500);
  background-color: hsl(var(--clr-neutral-100));
  color: hsl(var(--clr-slate-200));
}

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

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

.container {
  margin-inline: 1rem;
}

@media (min-width: 45em) {
  .container {
    margin-inline: 2.5rem;
  }
}

@media (min-width: 75em) {
  .container {
    margin-inline: 10.3125rem;
  }
}

/* ------------------- */
/* 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-slate-200 {
  background-color: hsl(var(--clr-slate-200));
}
.bg-slate-400 {
  background-color: hsl(var(--clr-slate-400));
}
.bg-slate-600 {
  background-color: hsl(var(--clr-slate-600));
}
.bg-pink-200 {
  background-color: hsl(var(--clr-pink-200));
}
.bg-pink-400 {
  background-color: hsl(var(--clr-pink-400));
}
.bg-neutral-100 {
  background-color: hsl(var(--clr-neutral-100));
}
.bg-orange-to-pink {
  background: var(--lg-orange-to-pink);
}
.bg-blue-to-pink {
  background: var(--lg-blue-to-pink);
}

.text-slate-200 {
  color: hsl(var(--clr-slate-200));
}
.text-slate-400 {
  color: hsl(var(--clr-slate-400));
}
.text-slate-600 {
  color: hsl(var(--clr-slate-600));
}
.text-neutral-100 {
  color: hsl(var(--clr-neutral-100));
}

.fs-300 {
  font-size: var(--fs-300);
  line-height: var(--lh-300);
}
.fs-400 {
  font-size: var(--fs-400);
  line-height: var(--lh-400);
}
.fs-500 {
  font-size: var(--fs-500);
  line-height: var(--lh-500);
}
.fs-600 {
  font-size: var(--fs-600);
  line-height: var(--lh-600);
}
.fs-700 {
  font-size: var(--fs-700);
  line-height: var(--lh-700);
}
.fs-800 {
  font-size: var(--fs-800);
  line-height: var(--lh-800);
}
.fs-900 {
  font-size: var(--fs-900);
  line-height: var(--lh-900);
}

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

.rounded-10 {
  border-radius: 10px;
}

@media (min-width: 75em) {
  .lg-rounded-15 {
    border-radius: 15px;
  }
}

/* ------------------- */
/* Block               */
/* ------------------- */
.landing {
  --grid-gap: 0;
  grid-template-rows: auto min-content;
  min-height: 100vh;
  min-width: fit-content;
  overflow-x: hidden;
}

.landing > main {
  --grid-gap: 0;
  grid-template-rows: min-content min-content auto;
}

.header {
  margin-top: 1rem;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.header img,
.footer img {
  max-width: 5.625rem;
}

.intro {
  --grid-gap: 2.875rem;
  margin-top: 2.375rem;
  justify-items: center;
}

.intro h1 {
  max-width: 15ch;
}

.intro p {
  max-width: 35ch;
  margin-block: 1.625rem 1.5rem;
}

.courses {
  background: linear-gradient(
    180deg,
    hsl(var(--clr-neutral-100)) 0%,
    hsl(var(--clr-neutral-200)) 100%
  );
  padding-bottom: 5rem;
}

.courses > .grid {
  --grid-gap: 1rem;
}

.courses h2 {
  padding: 1.5rem 1.75rem 2rem;
  margin-top: 1.5rem;
}

.courses article {
  position: relative;
}

.courses article > img {
  position: absolute;
  top: 0;
  left: 1.75rem;
}

.courses article > div {
  --flex-gap: 0;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0px 25px 50px hsl(var(--clr-blue-600) / 0.044);
  padding: 3.5rem 1.75rem 2rem;
  margin-top: 1.5rem;
}

.courses article > div p {
  margin-block: 1rem 1.5rem;
}

.courses article > div a {
  margin-top: auto;
}

.footer > .flex {
  justify-content: space-between;
  align-items: center;
  padding-block: 2.25rem;
}

@media (min-width: 45em) {
  .header {
    margin-top: 1.5rem;
  }

  .intro {
    --grid-gap: 0rem;
    grid-template-columns: 1fr 1fr;
    padding-block: 6.25rem;
    margin-top: 0;
    position: relative;
  }

  .intro > div {
    justify-self: flex-start;
  }

  .intro > picture {
    position: absolute;
    top: -10rem;
    right: -21rem;
  }

  .courses {
    margin-top: 4rem;
    padding-bottom: 5.375rem;
  }

  .courses > .grid {
    --grid-gap: 2rem 0.75rem;
    grid-template-columns: repeat(2, 1fr);
  }

  .courses h2 {
    padding: 3.5rem 2rem;
  }

  .courses article > div {
    padding: 3.5rem 2rem 2rem;
  }
}

@media (min-width: 75em) {
  .header img,
  .footer img {
    max-width: 7.125rem;
  }

  .intro {
    padding-block: 11rem;
  }

  .intro p {
    max-width: 34ch;
    margin-block: 1.875rem 2.5rem;
  }

  .intro > picture {
    top: -14rem;
    right: -31rem;
  }

  .courses {
    margin-top: 3.375rem;
    padding-bottom: 8.75rem;
  }

  .courses > .grid {
    --grid-gap: 3.5rem 1.875rem;
    grid-template-columns: repeat(3, 1fr);
  }

  .courses h2 {
    padding: 4rem 2rem;
  }

  .courses article > div {
    padding: 4rem 2rem 2.5rem;
  }

  .courses article > div p {
    margin-block: 1.5rem;
  }
}

/* ------------------- */
/* Exception           */
/* ------------------- */
.button {
  display: block;
  cursor: pointer;
  background-color: transparent;
  border: 0;
  padding: 0;
  font-size: var(--fs-400);
  line-height: var(--lh-400);
  font-weight: var(--fw-700);
  text-align: center;
}

.button[data-size="normal"] {
  padding: 0.625em 1.5em;
  border-radius: 1.75em;
}

.button[data-size="large"] {
  padding: 0.9375em 2.375em;
  border-radius: 2em;
}

.button[data-type="primary"] {
  background-color: hsl(var(--clr-slate-600));
  color: hsl(var(--clr-neutral-100));
}

.button[data-type="primary"]:hover,
.button[data-type="primary"]:focus {
  background-color: hsl(var(--clr-slate-400));
}

.button[data-type="secondary"] {
  background: var(--lg-orange-to-pink);
  color: hsl(var(--clr-neutral-100));
}

.button[data-type="secondary"]:hover,
.button[data-type="secondary"]:focus {
  background: var(--lg-neutral), var(--lg-orange-to-pink);
}

.button[data-type="tertiary"] {
  background: var(--lg-blue-to-pink);
  color: hsl(var(--clr-neutral-100));
}

.button[data-type="tertiary"]:hover,
.button[data-type="tertiary"]:focus {
  background: var(--lg-neutral), var(--lg-blue-to-pink);
}

.link {
  font-size: var(--fs-500);
  line-height: var(--lh-500);
  font-weight: var(--fw-700);
  text-align: center;
  color: hsl(var(--clr-pink-400));
  text-decoration: none;
}

.link:hover,
.link:focus {
  text-decoration: underline;
}

@media (min-width: 75em) {
  .button[data-size="normal"] {
    padding: 0.778em 1.778em;
    border-radius: 1.556em;
  }

  .button[data-size="large"] {
    padding: 1em 1.778em;
    border-radius: 1.778em;
  }

  .button[data-type="tertiary"] {
    background: linear-gradient(
      180deg,
      hsl(var(--clr-blue-400)) -54.32%,
      hsl(var(--clr-pink-600)) 100%
    );
  }
}
