/* ------------------- */
/* Custom properties   */
/* ------------------- */
:root {
  --clr-cyan-400: 185 75% 39%;
  --clr-blue-400: 227 10% 46%;
  --clr-blue-600: 197 85% 20%;
  --clr-blue-700: 229 23% 23%;
  --clr-neutral-100: 0 0% 100%;
  --clr-neutral-200: 228 9% 92%;

  --ff-sans: "Kumbh Sans", sans-serif;

  --fs-400: 0.9375rem;
  --fs-400: 1.125rem;
  --fs-600: 1.375rem;

  --fs-200: 0.625rem;
  --fs-400: 0.875rem;
  --fs-600: 1.125rem;

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

/* ------------------- */
/* 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.25;
  font-family: var(--ff-sans);
  font-size: var(--fs-400);
  font-weight: var(--fw-400);
  color: hsl(var(--clr-blue-400));
  background-color: hsl(var(--clr-cyan-400));
}

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

.block {
  display: block;
}

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

.fs-200 {
  font-size: var(--fs-200);
}
.fs-600 {
  font-size: var(--fs-600);
}

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

.text-blue-400 {
  color: hsl(var(--clr-blue-400));
}
.text-blue-700 {
  color: hsl(var(--clr-blue-700));
}

.tracking-wide {
  letter-spacing: 0.15em;
}

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

.mt-8 {
  margin-top: 0.5rem;
}
.mt-16 {
  margin-top: 1rem;
}
.p-24 {
  padding: 1.5rem;
}

/* ------------------- */
/* Block               */
/* ------------------- */
.container {
  place-items: 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.svg),
    url(/assets/bg-pattern-bottom.svg);
  background-position: right 52vw bottom 33vh, left 50vw top 48vh;
  background-repeat: no-repeat;
}

.container > main {
  grid-area: main;
}

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

.card {
  min-width: 20.375rem;
  width: 100%;
  background-color: hsl(var(--clr-neutral-100));
  border-radius: 15px;
  margin-inline: auto;
  box-shadow: 0px 50px 100px -20px hsl(var(--clr-blue-600) / 0.5);
  overflow: hidden;
}

@media (min-width: 35em) {
  .card {
    min-width: 21.875rem;
  }
}

.card > header {
  --grid-gap: 0;
  grid-template-rows: 1fr auto 1fr;
  grid-template-areas:
    "."
    "image"
    "bio";
  place-content: center;
  justify-items: center;
  min-height: 17.5rem;
  background-image: url(/assets/bg-pattern-card.svg);
  background-repeat: repeat-x;
  /*
   * Safari's default behavior is to preserve the aspect ratio for SVG images, which is different from the other browsers.
   * Setting a specific background-size would introduce white space on Safari especially when zooming in/out.
   * We can either:
   * 1) change background-size to 'auto' only which would still work fine in this example, or
   * 2) add 'preserveAspectRatio: none' to the SVG image.
   */
  background-size: auto 50%;
  border-bottom: 1px solid hsl(var(--clr-neutral-200));
}

.card > header img {
  grid-area: image;
  border-radius: 50%;
  aspect-ratio: 1;
  width: 6rem;
  box-sizing: content-box;
  border: 5px solid hsl(var(--clr-neutral-100));
}

.card > header .card__bio {
  grid-area: bio;
}

.card > header .card__bio .flex {
  --flex-gap: 0.5rem;
}

.card > section .card__stats {
  grid-template-columns: repeat(3, 1fr);
}
