@font-face {
  font-family: "Spline Sans Mono";
  src: url('fonts/SplineSansMono-VariableFont_wght.ttf') format('truetype');
}

:root {
  --foreground: rgb(200, 200, 225);
  --background: rgb(50, 60, 80);
}

html,
body {
  height: 100%;
  font-family: "Spline Sans Mono", monospace;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  margin: 0;
  padding: 1em;
  display: flex;
  box-sizing: border-box;
  cursor: url('img/cursor.svg') 50 50, auto;

  @media screen and (min-width: 1024px) {
    padding: 2em;
  }
}

main {
  border: 3px solid var(--foreground);
  width: 100%;
  /* height: 100%; */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-size: 0.8rem;
}

article {
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
}

.links {
  min-height: 0;
  width: 100%;
  height: 100%;
  container-type: size; 
}

.schematic {
  display: grid;
  aspect-ratio: 1;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  width: 80cqmin;
  height: 80cqmin;
  margin: auto;
}

.component {
  position: relative;
  color: var(--foreground);
  text-decoration: none;

  &::before,
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
}

.component a {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 10;
}

.component.wire--2-3 {
  grid-area: 2/3/2/3;

  &::before {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
    background-color: var(--foreground);
  }
}

.component.wire--4-3 {
  grid-area: 4/3/4/3;

  &::before {
    height: 1px;
    width: 50%;
    top: 50%;
    left: 50%;
    background-color: var(--foreground);
  }

  &::after {
    height: 50%;
    width: 1px;
    top: 0;
    left: 50%;
    background-color: var(--foreground);
  }
}

.component.wire--4-5 {
  grid-area: 4/5/4/5;

  &::before {
    height: 1px;
    width: 50%;
    top: 50%;
    left: 0;
    background-color: var(--foreground);
  }

  &::after {
    height: 50%;
    width: 1px;
    top: 50%;
    left: 50%;
    background-color: var(--foreground);
  }
}

.component.resistor--4-1 {
  grid-area: 4/1/4/1;

  &::before {
    height: 100%;
    width: 1px;
    left: 50%;
    top: 0;
    background-color: var(--foreground);
  }

  &::after {
    width: 18%;
    height: 50%;
    outline: 3px solid var(--foreground);
    background-color: var(--background);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.component.resistor--4-4 {
  grid-area: 4/4/4/4;

  &::before {
    height: 1px;
    width: 100%;
    top: 50%;
    left: 0;
    background-color: var(--foreground);
  }

  &::after {
    width: 50%;
    height: 18%;
    outline: 3px solid var(--foreground);
    background-color: var(--background);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.component.capacitor--3-2 {
  grid-area: 3/2/3/2;

  &::before {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
    background-color: var(--foreground);
  }

  &::after {
    width: 11%;
    height: 37%;
    border-left: 3px solid var(--foreground);
    border-right: 3px solid var(--foreground);
    background-color: var(--background);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.component.round {
  &::before {
    border-radius: 100%;
    border: 3px solid var(--foreground);
  }
}

.component.github {
  grid-area: 5/1/5/1;

  &::after {
    inset: 3px;
    background: transparent url('img/github.svg') no-repeat center;
    background-size: cover;
  }
}

.component.blog {
  grid-area: 1/3/1/3;

  &::after {
    inset: 15%;
    background: var(--foreground);
    mask: url('img/blog.png') no-repeat center;
    mask-size: contain;
  }
}

.component.x {
  grid-area: 3/1/3/1;

  &::after {
    inset: 27%;
    background: transparent url('img/x.svg') no-repeat center;
    background-size: contain;
  }
}

.component.bluesky {
  grid-area: 3/3/3/3;

  &::after {
    inset: 20%;
    background: transparent url('img/bluesky.svg') no-repeat center;
    background-size: contain;
  }
}

.component.instagram {
  grid-area: 5/5/5/5;

  &::after {
    inset: 25%;
    background: transparent url('img/instagram.svg') no-repeat center;
    background-size: contain;
  }
}

.component span {
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translateY(-50%);
  color: var(--foreground);
  font-size: 12px;
  white-space: nowrap;
}

@media screen and (min-width: 600px) {
  .component span {
    font-size: 14px;
  }
}

.component.instagram span {
  left: initial;
  right: 110%;
}

.component.x span {
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
}

.component img {
  width: 36px;
  height: auto;
  margin: 20px 0;
}

.title-block {
  border: solid var(--foreground);
  border-width: 2px 0 0 0;
  width: 100%;
  font-size: 20px;
  display: flex;

  @media screen and (min-width: 1024px) {
    width: 50%;
    max-width: 512px;
    margin-left: auto;
    border-width: 2px 0 0 2px;
  }
}

.title-block__logo {
  border-right: 1px solid var(--foreground);
  padding: 3%;
  display: flex;
  flex-direction: column;
  justify-content: center;

  img {
    width: 64px;
  }
}

.title-block__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-around;
}

.title-block__main h1 {
  padding: 1%;
  font-size: 18px;
  font-weight: normal;
  margin: 0;
  border-bottom: 1px solid var(--foreground);
}

.title-block__main ul {
  list-style-type: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.title-block__main ul li {
  padding: 1%;
  font-size: 14px;
  display: block;
}

.title-block__main ul li:not(:last-of-type) {
  border-bottom: 1px solid var(--foreground);
}

.title-block__main ul li.subdivide {
  display: flex;
  font-size: 12px;
  padding-top: 0;
  padding-bottom: 0;
}

.title-block__main ul li.subdivide span {
  display: inline-block;
  padding: 1% 2% 1% 0;
  height: 100%;
}

.title-block__main ul li.subdivide span:not(:first-of-type) {
  padding-left: 2%;
}

.title-block__main ul li.subdivide span:not(:last-of-type) {
  border-right: 1px solid var(--foreground);
}

.title-block__main em {
  white-space: nowrap;
}