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

:root {
  font-size: 16px;
  --page-padding: 2rem;

  --color-link: rgba(0, 0, 0, 0.8);
  --color-link-hover: #fff;
  --color-list-item: #fff;
  --color-title: #fff;
  --color-number: #fff;
  --color-bg-effect: white;
  --blendmode-effect: difference;
  --bg-blur: 0px;
  --font-size-list-item: 12px;
}

body {
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family: "JetBrains Mono", monospace;
  font-weight: 300;
  font-optical-sizing: auto;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 2px,
    #0000003d 3px
  );
  background-size: auto 100%;
  pointer-events: none;
}

a {
  text-decoration: none;
  color: var(--color-link);
  outline: none;
  cursor: pointer;
}

a:hover {
  text-decoration: none;
  color: var(--color-link-hover);
  outline: none;
}

/* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */
a:focus {
  /* Provide a fallback style for browsers
	 that don't support :focus-visible */
  outline: none;
}

a:focus-visible {
  /* Draw a very noticeable focus style for
	 keyboard-focus on browsers that do support
	 :focus-visible */
  outline: 2px solid red;
}

.unbutton {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.unbutton:focus {
  outline: none;
}

.frame {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: var(--page-padding);
  position: relative;
  display: grid;
  grid-row-gap: 1rem;
  grid-column-gap: 2rem;
  align-items: start;
  pointer-events: none;
  justify-items: start;
  grid-template-columns: auto auto;
  grid-template-areas: "title" "archive" "back" "github" "sponsor" "demos";
}

.frame #cdawrap {
  justify-self: start;
}

.frame a {
  pointer-events: auto;
}

.frame__title {
  grid-area: title;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

.frame__back {
  grid-area: back;
  justify-self: start;
}

.frame__archive {
  grid-area: archive;
  justify-self: start;
}

.frame__sub {
  grid-area: sub;
}

.content {
  display: flex;
  flex-direction: column;
  /* padding: 0 var(--page-padding) 2rem; */
  justify-content: center;
}

.content__title {
  font-size: 12px;
  color: var(--color-title);
}

.spacer {
  margin-top: 15vh;
}

.list {
  margin: 0;
  padding: 0;
  width: 100%;
  list-style: none;
  display: flex;
  flex-direction: column;
  counter-reset: item 0;
}

.content p {
  padding: 5vh var(--page-padding) 0;
  font-size: 12px;
  max-width: 900px;
}

.list__item {
  font-size: var(--font-size-list-item);
  cursor: pointer;
  width: 100%;
  display: grid;
  color: var(--color-list-item);
  grid-column-gap: 2rem;
  padding: 0.5rem 0;
  grid-template-columns: 100%;
  justify-content: space-between;
  align-items: start;
  justify-items: start;
}

@media screen and (max-width: 73em) {
  .list__item::before {
    /* Hide numbering for items 4-9 */
    content: counter(item, decimal-leading-zero);
    counter-increment: item;
    font-weight: 500;
    padding: 3px 3px 0;
    line-height: 0.8;
  }

  .list__item:nth-child(n + 4) {
    display: none; /* Hide items 4 and above */
  }
}

.list--alt .list__item::before {
  content: "EVT#" counter(item, decimal-leading-zero) "0";
}

.list__item-col {
  flex: none;
  padding: 3px 3px 0;
  line-height: 0.8;
}

.hover-effect .word {
  white-space: nowrap;
}

.hover-effect .char {
  position: relative;
}

.hover-effect {
  font-kerning: none;
  position: relative;
  white-space: nowrap;
}

.hover-effect--cursor-square .char {
  --opa: 0;
}

.hover-effect--cursor-square .char::after {
  content: "";
  width: 1ch;
  top: 0;
  left: 0;
  position: absolute;
  opacity: var(--opa);
}

.hover-effect--cursor-square .char::after {
  background: currentColor;
  height: 100%;
}

.hover-effect--bg,
.hover-effect--bg-south {
  --anim: 0;
}

.hover-effect--bg::after,
.hover-effect--bg-south::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: calc(100% + 3px);
  top: 0;
  background-color: var(--color-bg-effect);
  mix-blend-mode: var(--blendmode-effect);
  -webkit-backdrop-filter: blur(var(--bg-blur));
  backdrop-filter: blur(var(--bg-blur));
  transform-origin: 0% 50%;
  transform: scaleX(var(--anim));
}

.hover-effect--bg-south::after {
  z-index: -1;
  left: -8px;
  right: -8px;
  top: -8px;
  bottom: -8px;
  border-radius: 2px;
  height: auto;
  width: auto;
  transform-origin: 50% 100%;
  transform: scaleY(var(--anim));
}

@media screen and (min-width: 40em) {
  .list__item {
    grid-template-columns: auto 1fr 1fr 1fr auto;
  }
}

@media screen and (min-width: 53em) {
  .frame {
    grid-template-columns: auto auto auto auto 1fr 1fr;
    grid-template-areas: "title back archive github demos sponsor";
  }
  .frame #cdawrap,
  .frame__demos {
    justify-self: end;
  }
  .frame #cdawrap {
    text-align: right;
  }
}

@media screen and (min-width: 73em) {
  .list__item {
    grid-template-columns: 100px 30% 1fr 1fr 1fr;
  }
  .demo-4 .list__item {
    grid-template-columns: 100px 1fr 1fr auto;
  }
  .list__item-col:last-child {
    justify-self: end;
  }
}
