/* Adapted from Kokonut UI SmoothTab / Swipe Tabs by @dorianbaffier.
 * Copyright (c) 2025 kokonutUI. MIT notice: /licenses/kokonut-ui-MIT.txt
 * Source: https://github.com/kokonut-labs/kokonutui/blob/main/components/kokonutui/smooth-tab.tsx
 * The background and duplicate labels share the source asset's moving clip.
 */

.about-toc .about-toc-track {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  isolation: isolate;
}

/* Real anchors and visual copies have identical type, padding and wrapping. */
.about-toc .about-toc-track > a,
.about-toc .about-toc-label {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: normal;
  text-align: start;
  text-decoration: none;
}

.about-toc .about-toc-track > a {
  position: relative;
  color: var(--ash);
}

.about-toc .about-toc-track > a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* The shared site focus ring stays outside the clipped selection surface. */
.about-toc .about-toc-track > a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.about-toc .about-toc-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--ink);
  color: var(--parchment);
  clip-path: inset(0 100% 100% 0 round 4px);
  pointer-events: none;
  user-select: none;
}

.about-toc .about-toc-label {
  position: absolute;
  color: var(--parchment);
}

.about-toc.is-about-moving .about-toc-overlay {
  will-change: clip-path;
}

@media (prefers-reduced-motion: reduce) {
  /* JavaScript also snaps the mask and responds to preference changes. */
  .about-toc .about-toc-overlay {
    transition: none;
    animation: none;
    will-change: auto;
  }
}
