.tb-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0;
  border: 0;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-btn:hover::after {
  transform: scaleX(1);
}

.tb-btn--primary {
  background: var(--tb-ink);
  color: #fff;
}

.tb-btn--primary::after {
  background: var(--tb-brand);
}

.tb-btn--outline {
  border: 1px solid var(--tb-ink);
  color: var(--tb-ink);
  background: transparent;
}

.tb-btn--outline::after {
  background: var(--tb-ink);
}

.tb-btn--outline:hover {
  color: #fff;
}

.tb-btn--inverse {
  background: #fff;
  color: var(--tb-ink);
}

.tb-btn--inverse::after {
  background: var(--tb-line);
}

.tb-link-rule {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  text-decoration: none;
  transition: background-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-link-rule:hover {
  background-size: 100% 1px;
}

.tb-index {
  font-family: var(--tb-font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tb-steel);
}

.tb-single {
  color: var(--tb-ink);
}

.tb-single__hero {
  display: grid;
  gap: 3rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  border-bottom: 1px solid var(--tb-line);
}

.tb-single__back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--tb-steel);
  font-family: var(--tb-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tb-single__hero h1 {
  max-width: 14ch;
  margin: 1.25rem 0 0;
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 600;
  line-height: 0.95;
}

.tb-single__lede {
  max-width: 44rem;
  margin: 1.5rem 0 2rem;
  color: var(--tb-steel);
  font-size: 16px;
  line-height: 1.7;
}

.tb-single__hero aside {
  align-self: end;
}

.tb-single__image {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 2rem;
}

.tb-single__terms {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.tb-single__terms li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--tb-line);
  font-size: 14px;
}

.tb-single__body {
  max-width: 80rem;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.tb-single__content {
  max-width: 52rem;
  margin-top: 1.5rem;
  font-size: 16px;
  line-height: 1.8;
}

.tb-single__content > :first-child {
  margin-top: 0;
}

.tb-single__content h2,
.tb-single__content h3 {
  margin: 2.5rem 0 1rem;
  font-family: var(--tb-font-display);
  letter-spacing: -0.03em;
}

.tb-single__content a {
  color: var(--tb-brand);
}

.tb-single__related {
  padding: 3.5rem max(1.5rem, calc((100vw - 80rem) / 2));
  border-top: 1px solid var(--tb-line);
  background: var(--tb-mist);
}

.tb-single__related > div {
  display: grid;
  gap: 1px;
  margin-top: 1.5rem;
  border: 1px solid var(--tb-line);
  background: var(--tb-line);
}

.tb-single__related a {
  display: flex;
  min-height: 8rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  background: var(--tb-paper);
  color: var(--tb-ink);
  text-decoration: none;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.tb-single__related a:hover {
  z-index: 1;
  transform: translateY(-3px);
  background: var(--tb-mist);
}

.tb-single__related span {
  font-size: 18px;
  font-weight: 600;
}

.tb-single__related small {
  font-family: var(--tb-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tb-archive__hero {
  max-width: 80rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  border-bottom: 1px solid var(--tb-line);
}

.tb-archive__hero h1 {
  max-width: 14ch;
  margin: 1.5rem 0 0;
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 600;
  line-height: 0.95;
}

.tb-archive__hero > p:last-child {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  color: var(--tb-steel);
  font-size: 16px;
  line-height: 1.7;
}

.tb-archive__content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.tb-archive__grid {
  display: grid;
  gap: 1px;
  border: 1px solid var(--tb-line);
  background: var(--tb-line);
}

.tb-archive__card {
  display: flex;
  min-height: 18rem;
  flex-direction: column;
  padding: 2rem;
  background: var(--tb-paper);
  color: var(--tb-ink);
  text-decoration: none;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.tb-archive__card:hover {
  z-index: 1;
  transform: translateY(-3px);
  background: var(--tb-mist);
}

.tb-archive__card h2 {
  margin: 2rem 0 0;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
}

.tb-archive__card > p:not(.tb-index) {
  margin: 1rem 0 0;
  color: var(--tb-steel);
  font-size: 14px;
  line-height: 1.7;
}

.tb-archive__card > span {
  margin-top: auto;
  padding-top: 2rem;
  font-family: var(--tb-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tb-archive__pagination {
  margin-top: 2rem;
}

.tb-archive__pagination .nav-links {
  display: flex;
  gap: 0.5rem;
}

.tb-archive__pagination .page-numbers {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--tb-line);
  color: var(--tb-ink);
  text-decoration: none;
}

.tb-archive__pagination .current {
  border-color: var(--tb-ink);
  background: var(--tb-ink);
  color: #fff;
}

@media (min-width: 768px) {
  .tb-single__related > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tb-archive__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tb-single__hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 22rem);
    padding-top: 7rem;
    padding-bottom: 7rem;
  }

  .tb-single__related > div {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tb-archive__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tb-single__related a,
  .tb-archive__card {
    transition: none;
  }

  .tb-single__related a:hover,
  .tb-archive__card:hover {
    transform: none;
  }
}
