@font-face {
  font-family: "Manrope", Arial, sans-serif;
  src: url("/assets/fonts/manrope/Manrope-VariableFont_wght.ttf");
  font-display: swap;
}

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* https://kilianvalkhof.com/2022/css-html/your-css-reset-needs-text-size-adjust-probably/ */
  html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
  }

  body,
  h1,
  h2,
  h3,
  h4,
  p,
  figure,
  blockquote,
  dl,
  dd {
    margin: 0;
  }

  /* https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html */
  [role="list"] {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  body {
    min-block-size: 100vh;
    line-height: 1.6;
  }

  h1,
  h2,
  h3,
  button,
  input,
  label {
    line-height: 1.1;
  }

  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }

  p,
  li {
    text-wrap: pretty;
  }

  img,
  picture {
    max-inline-size: 100%;
    display: block;
  }

  a {
    text-decoration: none;
  }
}

@layer base {
  /* Primitives */
  :root {
    --clr-white: #ffffff;
    --clr-gray-200: #ecf2f8;
    --clr-gray-400: #9daec2;
    --clr-gray-500: #6e8098;
    --clr-gray-900: #48556a;

    --ff-1: "Manrope", sans-serif;

    --fs-300: 0.813rem;
    --fs-500: 1.25rem;

    --fw-light: 300;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    --spacing-50: 0.5rem;
    --spacing-100: 1rem;
    --spacing-200: 1.5rem;
    --spacing-300: 2rem;
    --spacing-400: 2.5rem;
    --spacing-480: 3rem;
    --spacing-500: 3.5rem;
    --spacing-600: 4rem;
    --spacing-1000: 6.5rem;
    --spacing-2000: 10rem;

    --border-radius-1: 0.75rem;

    --line-height-s: 1.3;
    --line-height-m: 1.4;

    --letter-spacing-1: 0.016em;
    --letter-spacing-2: 0.25em;

    /* Semantic Layer */
    /* in another selector for syntax highlighting reasons only */
  }
  :root {
    --clr-accent: var(--clr-gray-900);

    --measure: 60ch;

    --text-main: var(--clr-gray-500);
    --text-light: var(--clr-gray-400);
    --text-high-contrast: var(--clr-accent);

    --background-light: var(--clr-gray-200);
    --background-white: var(--clr-white);
  }
}

@layer base {
  html {
    font-family: var(--ff-1);
    line-height: var(--line-height-m);
  }

  body {
    font-size: var(--fs-300);
    color: var(--text-main);
  }

  h1,
  h2,
  h3,
  h4 {
    max-inline-size: var(--measure);
    color: var(--text-high-main);
    font-family: var(--ff-2);
    letter-spacing: var(--letter-spacing-1);
  }

  p {
    max-inline-size: var(--measure);
    font-weight: var(--fw-light);
    letter-spacing: var(--letter-spacing-1);
  }

  span {
    letter-spacing: var(--letter-spacing-1);
  }

  strong {
    font-weight: var(--fw-semibold);
  }
}

@layer layout {
  .cover {
    display: flex;
    min-block-size: 100vh;
    justify-content: center;
    align-items: center;
    padding: 6rem;
  }

  @media (max-width: 761px) {
    .cover {
      padding: var(--spacing-480);
    }
  }

  @media (max-width: 455px) {
    .cover {
      padding: var(--spacing-100);
    }
  }

  .box {
    --box-inline-padding: var(--spacing-400);
    --box-block-padding: var(--spacing-300);
    padding: var(--box-block-padding) var(--box-inline-padding);
  }

  .container {
    display: flex;
  }

  .with-sidebar {
    flex-wrap: wrap;

    & > :first-child {
      flex-basis: 17.8rem;
      flex-grow: 1;
    }

    & > :last-child {
      flex-basis: 0;
      flex-grow: 999;
      min-inline-size: 50%;
    }
  }

  .stack {
    --stack-space: var(--spacing-200);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .stack > * {
    margin-block: 0;
  }

  .stack > * + * {
    margin-block-start: var(--stack-space);
  }
}

@layer components {
  .card {
    max-width: 730px;
    background-color: var(--background-white);
    border-radius: var(--border-radius-1);
    overflow: hidden;

    & > figure {
      overflow: hidden;
    }
  }

  .bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  @media (max-width: 600px) {
    .card {
      & > figure {
        flex-basis: 100%;
        max-height: 200px;
      }

      & .bg-image {
        object-position: center;
      }
    }
  }

  .article-title {
    font-size: var(--fs-500);
    color: var(--text-high-contrast);
    font-weight: var(--fw-medium);
  }

  .article-summary {
    font-size: var(--fs-300);
    color: var(--text-main);
  }

  .avatar {
    align-items: center;
    gap: var(--spacing-100);

    & img {
      max-width: var(--spacing-400);
      border-radius: 50%;
    }

    & h2 {
      font-size: var(--fs-300);
      font-weight: var(--fw-regular);
      color: var(--text-high-contrast);
    }

    & span {
      font-size: var(--fs-300);
      font-weight: var(--fw-light);
      color: var(--text-light);
    }
  }

  .tooltip__text {
    font-size: var(--fs-300);
    letter-spacing: var(--letter-spacing-2);
    color: var(--clr-gray-400);
    font-weight: var(--fw-light);
  }

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

  .tooltip__link {
    display: block;
    color: var(--clr-white);
    text-decoration: none;
    min-width: 1rem;
    padding: 0.3rem 0;
  }

  .tooltip__link:hover {
    color: var(--clr-gray-400);
  }
}

@layer utilities {
  .justify\:between {
    justify-content: space-between;
  }

  .direction\:column {
    flex-direction: column;
  }

  .bg\:light {
    background-color: var(--background-light);
  }
}
