@font-face {
  font-family: "Tinos";
  font-weight: normal;
  src:
    local("Tinos"),
    url("./Tinos-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Tinos";
  font-weight: bold;
  src:
    local("Tinos"),
    url("./Tinos-Bold.ttf") format("truetype");
  font-display: swap;
}

:root {
  --primary: #b78bf4;
  --primary-2: #895bca;
  --max-content-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
}

body {
  margin: 0;
  background-color: #f7f2fe 4;
}

nav {
  --gap: 24px;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: var(--gap);
  align-items: center;
  background-color: #252429;
  height: 80px;
  z-index: 1;

  &:before,
  &:after {
    display: inline-block;
    content: " ";
    width: calc((100% - var(--max-content-width)) / 2);
  }

  &:before {
    margin-left: -12px;
  }

  &:after {
    margin-right: -12px;
  }

  label {
    svg {
      fill: white;
    }
  }

  span {
    margin-right: auto;
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
    padding: 16px 0;
  }

  a {
    display: inline-block;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    transition: color 0.15s;

    &:hover,
    &.active {
      color: var(--primary);
    }

    &:first-child {
      margin-right: auto;
    }
  }

  div {
    display: flex;
    gap: 24px;
  }

  label {
    display: none;
  }

  @media (max-width: 960px) {
    label {
      display: flex;

      input {
        display: none;
      }

      input ~ svg:nth-child(2),
      input:checked ~ svg:nth-child(3) {
        display: none;
      }

      input:checked ~ svg:nth-child(2),
      input ~ svg:nth-child(3) {
        display: block;
      }

      svg {
        width: 32px;
      }
    }

    div {
      position: fixed;
      top: 80px;
      bottom: 0;
      right: 0;
      display: flex;
      flex-direction: column;
      gap: 12px;
      background-color: #252429;
      padding: 24px;

      transition: transform 0.2s;
    }

    label:has(input) + div {
      transform: translateX(100%);
    }

    label:has(input:checked) + div {
      transform: translateX(0);
    }
  }
}

main {
  max-width: 100vw;
  overflow: hidden;
}

main.hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  padding: 12px;
  gap: 24px;
  max-width: var(--max-content-width);
  margin: auto;

  article {
    padding: 12px;
    border: 1px solid #b8b8b8;
    border-radius: 4px;
    width: 100%;
    max-height: min(650px, 70dvh);
    overflow: hidden;
    background-image: linear-gradient(to top, transparent 5%, black 20%);
    background-clip: text;
    color: transparent;
    box-shadow: 2px 4px 6px -1px rgba(0, 0, 0, 0.1);

    a {
      h2 {
        color: black;
        text-decoration: underline black;
        transition:
          color 0.15s,
          text-decoration 0.2s;

        &:hover {
          color: var(--primary-2);
          text-decoration: underline var(--primary-2);
        }
      }
    }

    img {
      width: 100%;
    }
  }
}

main.article {
  margin: auto;
  padding: 12px;
  width: 100%;
  max-width: 750px;
  text-align: justify;

  a:has(svg) {
    margin-top: 48px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #0000ee;

    svg {
      width: 24px;
      fill: #0000ee;
    }
  }

  p:has(img) {
    text-align: center;
  }
}

main.main-page {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 850px;
  margin: auto;
  gap: 64px;
  padding: 24px;
  height: calc(100svh - 80px);
  background-color: #f2f2f2;

  @media (max-width: 700px) {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  > div:has(img) {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: min(350px, 100vw);

    img {
      width: 100%;
    }
  }

  > div:has(a) {
    --gap: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gap);

    a {
      color: var(--primary-2);
      font-size: 1.8rem;
      font-weight: bold;
      text-decoration: none;
      position: relative;
      border: 3px solid var(--primary-2);
      padding: 4px 16px;
      border-radius: 8px;
      overflow: hidden;
      left: 0;
      transition: left 0.2s;
      white-space: nowrap;

      @media (pointer: fine) {
        &:hover {
          left: 12px;
        }
      }
    }

    @media (max-width: 700px) {
      a {
        width: calc(100%);
        font-size: 1.4rem;
      }
    }
  }
}
