* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
}

html {
  scroll-snap-type: y mandatory;
  /* scroll-behavior: smooth; */
}

body {
  font-family: Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background-color: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
}

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

  >a {
    text-decoration: none;

    &.anchor::after {
      content: "";
      display: inline-block;
      margin-left: 8px;
      vertical-align: baseline;
      background-image: url("/img/link.svg");
      background-size: cover;
      width: 16px;
      height: 16px;
      opacity: 0;
    }

    &.anchor:hover::after {
      opacity: 0.3;
    }
  }
}

h1>a.anchor::after {
  width: 20px;
  height: 20px;
}

h2>a.anchor::after {
  width: 32px;
  height: 32px;
}

h3>a.anchor::after {
  width: 20px;
  height: 20px;
}

h5>a.anchor::after {
  width: 12px;
  height: 12px;
  margin-left: 4px;
}

a {
  color: #fff;
}

h1 {
  font-size: 36px;
  font-weight: 600;
}

.hstack {
  display: flex;
}

.vstack {
  display: flex;
  flex-direction: column;
}

.zstack {
  display: grid;
  place-items: center;

  >* {
    grid-area: 1 / 1;
  }
}

nav#menu {
  display: flex;
  align-items: center;
  gap: 16px;
  position: fixed;
  width: 100%;
  top: 0;
  height: 56px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background-color: rgba(0, 0, 0, 0.4);
  border-bottom: solid 1px rgba(255, 255, 255, 0.12);
  box-sizing: content-box;
  overflow: hidden;
  z-index: 10;
  font-family: "JetBrains Mono";

  a {
    font-size: 14px;
    text-decoration: none;

    &.button {
      text-decoration: none;
      border: 1px solid #fff;
      border-radius: 4px;
      padding: 18px 24px;
      font-weight: 600;

      &.primary {
        border: unset;
        background-color: #FF4C4F;
        color: #000;

        &:hover {
          background-color: #fff;
        }
      }
    }
  }

  .logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;

    img {
      display: block;
    }

    #button-toggle {
      display: none;
      cursor: pointer;
      -webkit-user-select: none;
      user-select: none;
    }
  }

  .links {
    display: flex;
    flex: 1 0 0px;
    gap: 12px;
    padding: 0 16px 0 0;
    align-items: center;
    font-weight: 500;

    a {
      height: 56px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 20px 16px;
      position: relative;

      &::before {
        position: absolute;
        content: '';
        inset: 0 -20px;
        background: radial-gradient(50% 50% at 50% 100%, rgba(255, 255, 255, 0.19) 0%, rgba(255, 255, 255, 0) 100%);
        opacity: 0;
        transition: opacity 0.3s cubic-bezier(0, 0, 0.3, 1);
      }

      &:hover::before {
        opacity: 1;
        transition: none;
      }

      &.button {
        height: 32px;
        padding: 8px 18px;
      }
    }
  }

  .spacer {
    align-self: stretch;
    flex: 1 0 0px;
  }
}

main {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-family: Inter, sans-serif;
}

@media (max-width: 659px) {
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    >a.anchor::after {
      display: none;
    }
  }
}

@media (max-width: 659px) or (max-height: 459px) {
  nav#menu {
    flex-direction: column;
    gap: 0px;
    height: min-content;

    .logo {
      padding: 0px 10px 0px 16px;
      width: 100%;
      height: 56px;

      #button-toggle {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;

        #icon-close {
          display: none;
        }
      }
    }

    .links {
      display: none;
      flex-direction: column;
      gap: 0;
      align-items: flex-start;
      padding: 20px;
      width: 100%;

      a:hover::before {
        opacity: 0;
      }

      a.button {
        margin-top: 16px;
      }
    }
  }

  nav#menu.expanded {
    .links {
      display: flex;
    }

    .logo {
      #button-toggle {
        #icon-expand {
          display: none;
        }

        #icon-close {
          display: block;
        }
      }
    }
  }
}
