@layer base {
  body {
    background-image: url("components/backdrop-tiles/tiled-bg.svg");
    min-height: 100dvh;
    background-size: 50%;
    background-repeat: repeat;
  }
}

@layer components {

  .hero-section {
    padding-block: 5em;
  }

  .hero-small-text {
    font-size: 1.2rem;
    font-family: "Space Mono", monospace;
    margin: 0;
  }

  .hero-name {
    margin: 0;
    color: var(--text-1);
    font-size: clamp(2rem, 5vw + 1rem, 8rem);
    font-family: "Basement Grotesque", Iosevka, "Space Mono", monospace;
    text-transform: uppercase;
  }

  .short-description {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 1rem;

    & .desc {
      font-family: "Pixelify Sans Variable", Iosevka, monospace;
      max-width: 50%;
      font-size: clamp(1rem, 5vw, 1.2rem);
      opacity: 0.9;
      border-left: 0.5em solid var(--text-1);
      border-radius: 1em;
      padding-left: 1em;
      text-wrap: pretty;
    }
  }

  @media (max-width: 768px) {
    .short-description {
      flex-direction: column;

      & .circle-container {
        width: 20em;
        max-width: 100%;
      }

      & .desc {
        max-width: 100%;
        text-wrap: pretty;
      }
    }
  }

  .circle-container {
    max-width: 40%;
    aspect-ratio: 1;
    background: #3F515080;
    border-radius: 50%;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: clip;
    shape-outside: border-box;


    & .inner-circle {
      background: #050F0E66;
      position: absolute;
      border-radius: 50%;
      inset: 1rem;
      inset: 1lh;
      display: flex;
      padding: 5%;
      backdrop-filter: blur(10px);
      overflow: clip;

      &::before, &::after {
        content: "";
        position: absolute;
        width: 30%;
        aspect-ratio: 1;
        border-radius: 50%;
        top: 0;
        rotate: 85deg;
        z-index: -1;
        filter: blur(5rem);
      }

      &::before {
        background: #99F8FF;
        left: 0;
      }

      &::after {
        background: #0FF0DE;
        right: 0;
      }

      & .center-image {
        height: 100%;
        padding: 0;
        aspect-ratio: 1;
        background-size: cover;
        image-rendering: pixelated;
        background-image: url("assets/images/attacking-sprite-sheet.png");
        background-repeat: no-repeat;
        transform: rotateY(180deg);
        animation: run 1s infinite steps(5);
      }

      & .desc-text {
        position: absolute;
        inset: 0;
        text-wrap: wrap;
        width: 70%;
        text-align: center;
        font-family: "Pixelify Sans Variable", Iosevka, monospace;
        font-size: clamp(0.5rem, 5vw, 1.5rem);
        margin-inline: auto;
      }
    }
  }

  .showcase-sections-container {
    display: grid;
    gap: 2rem;
    grid-row-gap: 4em;
    grid-template-columns: repeat(auto-fit, minmax(40%, 1fr));
    @media screen and (max-width: 768px) {
      grid-template-columns: 1fr;
    }

    & .showcase-section {
      margin-block-end: 3em;

      & > img {
        width: 85px;
        aspect-ratio: 1;
        image-rendering: pixelated;
      }

      & > h2 {
        font-style: italic;
        margin: 0;
      }
    }


  }

  .feature-card-list {
    --padding: 1rem;
    --radius: 1rem;
    --card-bg: var(--surface-1);

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
    padding: 0;

    & ::marker {
      content: "";
      display: none;
    }

    & project-card {
      position: relative;
      object-fit: contain;
      display: block;
      overflow: clip;
      /*padding: var(--padding);*/
      box-sizing: border-box;

      background: var(--card-bg);

      border-radius: var(--radius);

      &:hover img {
        filter: none;
        object-position: top;
      }


      & img {
        isolation: isolate;
        width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: calc(var(--radius) / 1.5);
        background: #0FF0DE;
        /*Teal overlay*/
        filter: brightness(0.8) sepia(1) saturate(2) hue-rotate(120deg);
        object-position: bottom;
        image-rendering: pixelated;
        transition: all 1s ease-in-out;
      }

      & h4 {
        position: absolute;
        height: 2rem;
        bottom: 0;
        left: 0;
        margin: 0;
        padding: var(--padding) var(--padding) 0 0;
        background: var(--card-bg);
        border-radius: 0 var(--radius) 0 0;
        color: var(--text-clr);
        transition: all 1s ease-in-out;
        box-shadow: -1rem 1rem 0 1rem var(--card-bg);

        &::before, &::after {
          content: "";
          position: absolute;
        }
      }

      &:hover h4 {
        color: var(--text-1);
        translate: 1rem -1rem;
      }

    }
  }

  .stories-container {
    & .stories-list {


      & ::marker {
        content: "";
      }

      & a {
        --text-1: #17e5d2;
        font-family: Iosevka, "Space Mono", monospace;
        text-decoration: none;
        color: var(--text-2);
        font-weight: bold;
        font-size: 1rem;
        font-style: italic;

        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--overlay-2);

        &:hover {
          color: var(--text-1);
          background: var(--overlay-2);

          & .story-date {
            color: var(--text-2);
          }
        }
      }

      & .story-date {
        font-weight: bold;
        font-size: 0.8rem;
        font-style: normal;
        color: var(--text-3);
        float: right;
      }
    }
  }

  .arts-container {
    & .arts-list {
      & img {
        width: 100%;
        aspect-ratio: 10 / 1;
        object-fit: cover;
        border-radius: 1rem;
        object-position: top;
        filter: brightness(0.8) sepia(1) saturate(2) hue-rotate(120deg);
        transition: all 1s ease-in-out;

        &:hover {
          filter: none;
          object-position: center;
          aspect-ratio: 2/1;
        }
      }
    }
  }

  .quests-section {
    & > img {
      width: 85px;
      aspect-ratio: 1;
      image-rendering: pixelated;
    }

    & > h2 {
      font-style: italic;
      margin: 0;
    }


    .side-quest-list {
      padding-left: 2em;
      font-family: monospace;
      font-weight: bold;

      & li {
        text-shadow: 3px 3px 0 rgba(227, 227, 227, 0.26);
        font-style: italic;

        &:hover::marker {
          color: #00ff8e;
        }

        &::marker {
          content: ":> ";
          color: var(--text-1);
          font-size: 1em;
          font-weight: bold;
          font-style: italic;
          transition: all 300ms ease-in-out;
        }

        padding-block: 0.5em;
        font-size: 1.2em;
        transition: all 300ms ease-in-out;
        width: max-content;

        &:hover {
          color: var(--text-1);
          padding-inline-start: 1em;
        }
      }

      & li a {
        color: var(--text-2);
        text-decoration: none;
      }
    }
  }

  .info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    place-content: center;
    margin-block: 2em;

    @media screen and (max-width: 650px) {
      grid-template-columns: repeat(2, 1fr);
    }

    & a, p {
      color: var(--text-2);
      text-decoration: none;
      font-family: Iosevka, "Space Mono", monospace;
      font-weight: bold;
      font-style: italic;
      margin-block: 0.2em;
      text-align: center;
    }

    & > div {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      flex: 1;
      position: relative;
      padding: 1rem;
      border-radius: 1rem;
      border: 2px solid var(--overlay-2);
      font-weight: bold;
      isolation: isolate;
      overflow: clip;

      img {
        display: block;
        image-rendering: pixelated;
        width: 3em;
        aspect-ratio: 1;


        &.sprite {
          width: 3em;
          aspect-ratio: 1;
          animation: run 1s infinite steps(7);
          object-fit: cover;
        }
      }

      &.large-image {
        & img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          z-index: -1;
          position: absolute;
          inset: 0;
        }
      }
    }


    github-heatmap {
      display: grid;
      grid-auto-flow: column;
      grid-template-rows: repeat(7, auto);
      gap: 12px;
    }

    github-heatmap div {
      position: relative;
      width: 18px;
      height: 18px;
      border-radius: 2px;
      box-sizing: border-box;
      background: #222c2c;
      color: transparent;
      overflow: hidden;
      user-select: none;
    }

    github-heatmap div::after {
      content: "";
      position: absolute;
      inset: 0;
      background: var(--clr0-light, #54f8c1);
    }

    github-heatmap div[data-level="0"]::after {
      opacity: 0;
    }

    github-heatmap div[data-level="1"]::after {
      opacity: 0.3;
    }

    github-heatmap div[data-level="2"]::after {
      opacity: 0.6;
    }

    github-heatmap div[data-level="3"]::after {
      opacity: 1;
    }

    & .counter > p {
      font-family: Iosevka, "Space Mono", monospace;
      font-style: italic;
      font-weight: bold;
      letter-spacing: 0.1em;
      font-size: 3em;
    }
  }
}

@keyframes run {
  from {
    background-position: left;
    object-position: left;
  }
  to {
    background-position: right;
    object-position: right;
  }
}
