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

:root {
  font-size: 16px;
  --page-padding: 2rem;
  --color-text: #000;
  --color-bg: #fff;
  --color-link: rgba(0, 0, 0, 0.8);
  --color-link-hover: #000;
  --color-list-item: #000;
  --color-title: #000;
  --color-number: #000;
  --color-bg-effect: white;
  --blendmode-effect: difference;
  --bg-blur: 0px;
  --font-size-list-item: 18px;
}

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;
}

.demo-2 {
  --color-text: #fff;
  /* --color-bg: #252a33; */
  --color-link: #717781;
  --color-link-hover: #fff;
  --color-list-item: #c7c0b3;
  --color-title: #5b6b85;
  --color-number: #fff;
}

.demo-3 {
  --color-text: #fff;
  --color-bg: #1d2619;
  --color-link: #8adcc0;
  --color-link-hover: #fff;
  --color-list-item: #c5c5c5;
  --color-title: #41483e;
  --color-number: #fff;
}

.demo-4 {
  background-image: url(../img/noise.png), url(../img/bg.jpg);
  background-size: 100px, cover;
  background-position: 50% 50%;
  --color-text: #fff;
  --color-bg: #000;
  --color-link: #515151;
  --color-link-hover: #fff;
  --color-list-item: #ffffffd9;
  --color-title: #2d2d2d;
  --color-number: #615f60;
  --color-bg-effect: rgb(229 222 204 / 10%);
  --blendmode-effect: none;
  --bg-blur: 5px;
  --font-size-list-item: clamp(1rem, 4vw, 2rem);
}

.demo-4::after {
  display: none;
}

.demo-5 main {
  mix-blend-mode: difference;
}

/* 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;
}

.s1 {
  display: flex;
  flex-direction: column;
  height: auto;
  justify-content: center;
  padding: 6.25rem var(--page-padding) 17.5rem;
}

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

.spacer {
  margin-top: 15vh;
}

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

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

.s1 .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;
}

.demo-4 .list__item {
  padding: 0.85rem 0;
}

.s1 .list__item::before {
  color: var(--color-number);
  content: counter(item, decimal-leading-zero);
  counter-increment: item;
  font-weight: 500;
  padding: 3px 3px 0;
  line-height: 0.8;
}

.demo-4 .list__item::before {
  font-size: 0.8rem;
}

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

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

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

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

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

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

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

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

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

.s1 .hover-effect--bg::after,
.s1 .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));
}

.s1 .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) {
  .s1 .list__item {
    grid-template-columns: auto 1fr 1fr 1fr auto;
  }
}

@media screen and (min-width: 73em) {
  .s1 .list__item {
    grid-template-columns: 100px 30% 1fr 1fr 1fr;
  }

  .demo-4 .list__item {
    grid-template-columns: 100px 1fr 1fr auto;
  }

  .s1 .list__item-col:last-child {
    justify-self: end;
  }
}
