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

:root {
  font-size: 13px;
  --color-text: #fff;
  --color-bg: #000;
  --color-link: #fff;
  --color-link-hover: #fff;
  --page-padding: 1.5rem;
}

body {
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family: 'forma-djr-mono', monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-transform: uppercase;
}

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

  &:hover {
    text-decoration: underline;
    color: var(--color-link-hover);
  }

  &:focus {
    outline: none;
    background: lightgrey;

    &:not(:focus-visible) {
      background: transparent;
    }

    &:focus-visible {
      outline: 2px solid red;
      background: transparent;
    }
  }
}

.frame {
  padding: 1rem var(--page-padding) 0;
  display: grid;
  z-index: 1000;
  position: relative;
  grid-row-gap: 1rem;
  grid-column-gap: 1.5rem;
  pointer-events: none;
  justify-items: start;
  grid-template-columns: auto auto auto 1fr;
  grid-template-areas:
    'title title title'
    'archive github ...'
    'tags tags tags'
    'sponsor sponsor sponsor';

  #cdawrap {
    justify-self: start;
    grid-area: sponsor;
  }

  a,
  button {
    pointer-events: auto;
  }

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

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

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

  .frame__github {
    grid-area: github;
  }

  .frame__tags {
    grid-area: tags;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .frame__demos {
    grid-area: demos;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  @media screen and (min-width: 53em) {
    padding: var(--page-padding);
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    width: 100%;
    grid-template-columns: auto auto auto auto 1fr;
    grid-template-rows: auto auto;
    align-content: space-between;
    grid-template-areas:
      'title back github archive sponsor'
      'tags tags tags tags ...';

    .frame__tags {
      align-self: end;
    }

    .frame__demos,
    #cdawrap {
      justify-self: end;
      text-align: right;
      max-width: 250px;
    }
  }
}

.content {
  padding: 100vh var(--page-padding) 25vh;
}

.group {
  display: grid;
  margin-bottom: 10vh;
  display: flex;
  flex-direction: column;
  flex: 1 1 100px;
}

.el {
  white-space: nowrap;
  filter: blur(0px);
  text-transform: uppercase;
  opacity: 0.6;
}

.el--xl {
  font-size: clamp(2rem, 20vw, 15rem);
  opacity: 1;
  font-family: 'lores-12', sans-serif;
  font-weight: 400;
}

.pos-2 {
  margin-left: 25vw;
}

.pos-3 {
  margin-left: 70vw;
}

.pos-4 {
  margin-left: auto;
}

.pos-5 {
  margin-top: 200px;
  opacity: 1;
}

.pos-6 {
  margin-left: auto;
  margin-top: 200px;
  opacity: 1;
}

.pos-7 {
  margin-top: 200px;
  opacity: 1;
  filter: blur(1.2px);
}

.pos-8 {
  margin-left: 25vw;
  margin-top: 50px;
  opacity: 1;
  filter: blur(2px);
}

.pos-9 {
  margin-left: 25vw;
  margin-top: 250px;
}

.pos-10 {
  margin-left: 70vw;
  margin-top: 40vh;
}

.logo {
  font-size: clamp(2rem, 10vw, 4rem);
  font-family: 'lores-12', sans-serif;
  font-weight: 400;
}

@keyframes blink-cursor {
  from,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.typing-indicator {
  display: inline-block;
  animation: blink-cursor 0.7s linear infinite;
}

.fixed {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  position: fixed;
  left: 0;
  top: 0;
}

.related {
  container-type: inline-size;
}

.related p {
  text-align: center;
  padding-top: 3rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 5rem var(--page-padding) 10vh;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

/* Grid item (the link) */
.grid__item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
}

/* Image block */
.grid__item-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  transition: all 0.5s ease;
}

/* Subtle zoom on hover */
.grid__item:hover .grid__item-img {
  transform: scale(1.1);
  opacity: 1;
}

/* Title */
.grid__item-title {
  padding: 1rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
}

/* Optional: nicer focus state for accessibility */
.grid__item:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@container (max-width: 800px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .grid__item-img {
    display: none;
  }
  .grid__item-title {
    padding: 0.25rem;
    line-height: 1;
  }
}
