.tags-page {
  --tags-line: color-mix(in oklch, var(--surface1) 72%, var(--text));
  --tags-muted: color-mix(in oklch, var(--subtext1) 78%, var(--base));
  --tags-accent: var(--lavender);
  display: grid;
  gap: 1.5rem;
  padding: 1.25em 1.25rem 0;
}

.tags-hero {
  position: relative;
  display: grid;
  gap: 0.6rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--tags-line);
}

.tags-hero::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: color-mix(in oklch, var(--text) 50%, var(--base));
}

.tags-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  color: var(--tags-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: lowercase;
}

.tags-hero__sep {
  opacity: 0.3;
}

.tags-hero__roman {
  position: absolute;
  right: 0;
  bottom: 1.5rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.tags-hero h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-style: italic;
  font-synthesis: none;
  font-size: 3.5rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.tags-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: baseline;
  contain: layout paint style;
}

.tags-index__item {
  --tag-size: 1rem;
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
  padding-block: 0.15rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-style: italic;
  font-synthesis: none;
  font-size: var(--tag-size);
  line-height: 1.2;
  text-decoration: none;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition:
    color 140ms ease,
    text-decoration-color 140ms ease;
}

.tags-index__item::before {
  color: var(--tags-accent);
  content: "#";
  font-family: var(--font-mono);
  font-size: 0.76em;
}

.tags-index__item:hover,
.tags-index__item:focus-visible {
  color: var(--tags-accent);
  text-decoration-color: currentColor;
}

.tags-index__item:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--tags-accent) 68%, transparent);
  outline-offset: 3px;
}

.tags-index__name {
  overflow-wrap: anywhere;
}

.tags-index__count {
  color: var(--tags-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.tags-index__count::before {
  content: "(";
}

.tags-index__count::after {
  content: ")";
}

@media (max-width: 720px) {
  .tags-page {
    gap: 1.25rem;
  }

  .tags-hero h1 {
    font-size: 2.6rem;
  }

  .tags-hero__roman {
    font-size: 3.5rem;
  }
}

@media (max-width: 480px) {
  .tags-page {
    padding: 1rem 0.875rem 0;
  }

  .tags-hero h1 {
    font-size: 2.1rem;
  }

  .tags-hero__roman {
    font-size: 2.5rem;
    opacity: 0.04;
  }

  .tags-index {
    gap: 0.5rem 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tags-index__item {
    transition: none;
  }
}
