/* ---------- project index ---------- */

/* Figma 797:2373 (closed) / 797:2426 (open). A jump list for the stream: 35
   projects that you can only reach by scrolling through them is browsable but
   not navigable, and this is the direct route.

   THE CLOSED PILL IS THE SAME LIST, CLIPPED TO ONE ROW AND SCROLLED TO THE
   PROJECT YOU ARE READING. That is why the card's contents do not move when it
   opens — the height grows, the scroll position stays, and the name you were
   looking at is still exactly where it was. A separate label row would have had
   to cross-fade into a list that already contained it.

   Width and height are both driven from measured pixels (--idx-w, and the clip
   height set in JS) for the same reason the contact pill is: `auto` and
   `max-content` do not interpolate, so a box that has to animate between two
   intrinsic sizes needs both of them as numbers. */
/* WIDTH IS SET INLINE FROM JS, not through a custom property. `width:var(--a)`
   transitioning to `width:var(--b)` does not interpolate — the same trap the
   project page's flex-basis hit — so the card sat at its closed width for the
   whole 620ms and then snapped. Two plain px values on the element animate. */
.proj-index{
  /* the same frosted chip as the menu button, not Figma's flat #f5f5f5 —
     Anthony asked for it to sit in the same family as the other controls */
  background-color:var(--chip);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  /* 15px, in BOTH states. Figma draws the pill at 46, which only renders as a
     capsule because a radius is clamped to half the box's height — 15 at 30px
     tall. Animating 46 -> 15 released that clamp as the card grew, so the
     in-between values actually rendered and the corners ballooned into a soft
     rectangle before settling. 15 is what the pill already looked like. */
  border-radius:var(--chip-r);
  /* THE PADDING LIVES HERE, NOT ON THE CLIP. With it on the clip the closed
     window was 10.5px taller than one row at each end while the gap between
     rows is only 10 — so half a pixel of the PREVIOUS project's name showed
     above the current one, and more than that while the list was moving. The
     clip is now exactly one row tall and cannot show anything else.

     THE TOP PADDING NEVER CHANGES. It is what makes the closed pill 30px tall,
     and the clip sits directly beneath it — so growing it to Figma's 20 on open
     carried the current name 9.7px down the screen as the card expanded. The
     name has to sit still while the card grows around it, exactly as the
     contact card's label does. The open card takes its extra breathing room at
     the BOTTOM instead, where there is nothing to push. */
  padding:var(--idx-pad-top,10px) var(--pad) var(--idx-pad-bottom,10px);
  overflow:hidden;
  cursor:pointer;
  /* the same curve and duration as the contact card, so the two header
     controls feel like one family */
  transition:
    width var(--open) var(--glide),
    padding-bottom var(--open) var(--glide),
    background-color var(--hover) var(--ease),
    opacity 260ms var(--ease),
    visibility 0s linear 260ms,
    order 0s linear 260ms,
    filter 520ms var(--ease);
}
@media (hover:hover){.proj-index:not(.is-open):hover{background-color:var(--chip-hover)}}.proj-index:not(.is-open).is-pressed{background-color:var(--chip-hover)}
.proj-index.is-open{
  padding-bottom:var(--idx-pad-bottom-open,20px);
}

/* The clip is the window; its height is the only thing that animates the
   open. Padding lives here rather than on the card so that at rest the single
   visible row still sits in Figma's 30px pill. */
/* Closed it is a label, so it does not scroll: `overflow:hidden` until the card
   is open. Being able to spin the list inside the pill was the other half of
   the same bug — a closed control that reads as a caption should not move. */
.idx-clip{
  overflow:hidden;
  overscroll-behavior:contain;
  scrollbar-width:none;
  transition:height var(--open) var(--glide);
}
.idx-clip::-webkit-scrollbar{display:none}
.proj-index.is-open .idx-clip{overflow-y:auto}

.idx-list{
  list-style:none;
  margin:0;
  /* room for ink that sits outside the cap-trimmed box — accents above, like
     the marks on Hìtëkw, and descenders below, like the g in Earbugs. Set from
     JS against the real glyphs; see measureIndex. */
  padding:var(--idx-over-top,0) 0 var(--idx-over-bottom,0);
  display:flex;
  flex-direction:column;
  gap:10px;                    /* Figma 797:2438 */
}

/* Resting at 20% and lifting to full on hover is the inverse of the site's
   one link hover (lighten to .55), and deliberately so: here the dimming IS
   the resting state, so revealing is the only direction left to go. */
.idx-item{
  display:block;
  width:100%;
  padding:0;
  border:0;
  background:none;
  font:inherit;
  font-size:var(--fs-s);
  color:var(--ink);
  text-align:left;
  white-space:nowrap;
  cursor:pointer;
  opacity:.2;
  transition:opacity 200ms var(--ease);
}
@media (hover:hover){.idx-item:hover{opacity:.6}}.idx-item.is-pressed{opacity:.6}
/* the one you are reading */
.idx-item.is-current{opacity:1}

/* The descriptor pill. Pinned to the hovered ROW and parked just left of the
   index, rather than following the cursor or opening beneath the name:

   - beneath the name, every row below it would shift down as the pointer moved,
     so the name you were aiming for would keep moving away from you;
   - on the cursor, it would sit inside the list on top of the very names you
     were scanning, jitter with every movement, and read as the cursor badge —
     whose rule is that it says what a click DOES, which "Backpack" is not.

   Out here it never covers a name, never reflows anything, and only moves when
   you change rows. Anchored by `right` so a longer label grows leftward, away
   from the list, and glides vertically on transform. */
.idx-desc{
  position:fixed;
  top:0;
  right:var(--desc-right,0);
  height:var(--chip-h);
  padding:0 var(--pad);
  display:flex;
  align-items:center;
  border-radius:var(--chip-r);
  background-color:var(--chip);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  font-size:var(--fs-s);
  color:var(--ink);
  white-space:nowrap;
  pointer-events:none;
  opacity:0;
  transform:translate3d(0,var(--desc-y,0),0);
  transition:opacity 180ms var(--ease);
}
.idx-desc.is-on{opacity:1}
/* only glides once it is already showing — appearing, it fades in where it
   belongs rather than sliding in from wherever it last was */
.idx-desc.is-on.is-gliding{
  transition:opacity 180ms var(--ease),transform 260ms var(--ease);
}
