:root {
  /* Default (Light Mode) Colors */
  --bg-color: #fff;
  --text-color: #1d1d1d;
  --accent-color: #1313bf;
  --caption-color: #fff;
  --muted-color: #bebebe;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Mode Overrides */
    --bg-color: #0c0c0c;
    --text-color: #ebebeb;
    --accent-color: #4958ff;
    --muted-color: #2e2e2e;
  }
}

* {
  font-family: NeueBit;
  margin: 0;
  user-select: none;
  -moz-user-select: none;
}

.blur {
  display: none;
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100vw;
  height: 80px;
}

.a {
  display: none;
  position: fixed;
  bottom: 1rem;
  height: 20px;
  width: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
}

html {
  height: 100vh;
  width: 100vw;
  overscroll-behavior: none;
  background-color: var(--bg-color);
}

body {
  height: 100vh;
  position: relative;
  background-color: var(--bg-color);
  color: var(--text-color);
}

main {
  padding: 2px;
}

header {
  padding-block: 4rem;
  align-items: start;
  justify-content: center;
}

h1 {
  font-size: 3rem;
  width: fit-content;
  transform: skew(-6.9deg);
}

.bio {
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.column span {
  font-size: 1.75rem;
  margin: 0;
  max-width: 380px;
}

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

a:hover {
  color: var(--accent-color);
}

#tabs {
  top: 0;
  z-index: 69;
  background-color: var(--bg-color);
  position: sticky;
  display: flex;
  padding-inline: 2px;
  padding-block: 4px;
}

#tabs button {
  border: 1px solid transparent;
  color: var(--text-color);
  padding: 0.5rem 1rem;
  background: transparent;
  opacity: 0.6;
  font-size: 1.3rem;
  font-weight: bold;
  font-family: NeueBit;
  cursor: default;
}

#tabs button.active {
  background: repeating-linear-gradient(
    45deg,
    var(--muted-color),
    var(--muted-color) 1.5px,
    transparent 1.5px,
    transparent 4px
  );
  border: 1px solid #858585;
  opacity: 1;
  transition: background 0.3s ease;
}

@media (min-width: 292px) {
  #gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto !important;
  }

  .md {
    aspect-ratio: 1 / 2;
    height: 100%;
    max-width: 100%;
  }

  .lg,
  .sm {
    aspect-ratio: 1 / 1;
  }

  header,
  #tabs {
    padding-inline: 0.5rem;
  }
}

@media (min-width: 548px) {
  #gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  header,
  #tabs {
    padding-inline: 1rem;
  }

  .blur,
  .a {
    display: block;
  }
}

@media (min-width: 804px) {
  #gallery {
    grid-template-columns: repeat(4, 1fr);
  }

  .bio {
    flex-direction: row;
  }

  header,
  #tabs {
    padding-inline: 2rem;
  }
}

@media (min-width: 1060px) {
  #gallery {
    grid-template-columns: repeat(5, 1fr);
  }

  header,
  #tabs {
    padding-inline: 4rem;
  }
}

@media (min-width: 1316px) {
  #gallery {
    grid-template-columns: repeat(6, 1fr);
  }

  header,
  #tabs {
    padding-inline: 6rem;
  }
}

@media (min-width: 1572px) {
  #gallery {
    grid-template-columns: repeat(7, 1fr);
  }
}

@media (min-width: 1828px) {
  #gallery {
    grid-template-columns: repeat(8, 1fr);
  }
}

#gallery {
  max-width: 100%;
  display: grid;
  gap: 4px;
  grid-auto-rows: 256px;
  grid-auto-flow: dense;
  padding-bottom: 4rem;
}

figure {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.hover:hover img {
  scale: 1.05;
  filter: brightness(0.7) blur(2px);
  transition: all 0.3s ease;
}

.hover::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none; /* Don’t block clicks */
  background-image: radial-gradient(#000 1px, transparent 1px);
  background-size: 6px 6px; /* Dot spacing */
  opacity: 0;
  transition: opacity 0.3s ease;
  /* By default, no overlay visible */
  z-index: 69;
  /* The magic: blend the dots with the image behind it */
  mix-blend-mode: multiply;
}

.halftone-container:hover::after {
  opacity: 1; /* Adjust dot intensity */
}

img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.color {
  position: absolute;
  width: 100%;
  height: 100%;
}

.caption {
  height: 13px;
  width: 100%;
  font-weight: bold;
  overflow: hidden;
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  font-size: 1.1rem;
  z-index: 3;
}

.caption span {
  color: var(--caption-color);
  opacity: 0.8;
  display: block;
  position: absolute;
  transition: ease 0.2s;
}

.caption span:nth-child(2) {
  padding-inline: 0.1rem;
  background-color: var(--text-color);
  color: var(--bg-color);
  transform: translateY(-105%);
}

figure:hover .caption:has(span:nth-child(2)) span:nth-child(1) {
  transform: translateY(105%);
}

figure:hover .caption span:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
}

.sm {
  grid-column: span 1;
  grid-row: span 1;
}

.md {
  grid-column: span 1;
  grid-row: span 2;
}

.lg {
  grid-column: span 2;
  grid-row: span 2;
}
