/* ===================================================================
   nav.css — the persistent index, and the closing sections.

   The page is ~19,000px of vertical scroll across six projects. The
   thing a reader actually needs is not a menu, it is an answer to
   "where am I and how much is left". So the nav is a scroll-spy: it
   states the current project, and opens into a jump list on demand.
   =================================================================== */

.nav-index {
  position: fixed;
  top: clamp(1rem, 2.5vh, 1.75rem);
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .45rem .5rem .45rem .95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(17,17,17,.04), 0 16px 40px -18px rgba(17,17,17,.22);
  transition: transform .6s var(--ease), opacity .4s var(--ease);
  opacity: 0;
}
.nav-index.is-on { transform: translateX(-50%) translateY(0); opacity: 1; }

.nav-index__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent, var(--fg));
  flex: none;
  transition: background .45s var(--ease);
}

.nav-index__label {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
  transition: color .3s var(--ease);
}
.nav-index__label b { color: var(--fg-1); font-weight: 400; }

.nav-index__toggle {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--fg);
  color: #fff;
  font-family: var(--font-text);
  font-size: .75rem;
  font-weight: 500;
  transition: background .3s var(--ease);
}
.nav-index__toggle:hover { background: #000; }
.nav-index__toggle svg { width: .65em; height: .65em; transition: transform .4s var(--ease); }
.nav-index[data-open="true"] .nav-index__toggle svg { transform: rotate(45deg); }

/* ---- the jump list ---- */

.nav-sheet {
  position: fixed;
  inset: 0;
  z-index: 89;
  display: grid;
  place-items: center;
  background: rgba(247, 247, 245, .86);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s var(--ease);
}
.nav-sheet.is-open { opacity: 1; pointer-events: auto; }

/* The sheet is the one place with room, so the list shares it with a
   preview: hover a row and its screen appears at a size you can read. */
.nav-sheet__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(17rem, 28vw, 25rem);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  width: 100%;
  max-width: 76rem;
  padding: 0 var(--gutter);
}

.nav-sheet__list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.nav-sheet__preview {
  margin: 0;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  box-shadow: 0 2px 4px rgba(17,17,17,.04), 0 32px 60px -28px rgba(17,17,17,.28);
  opacity: 0;
  transform: translateY(10px) scale(.985);
  transition: opacity .4s var(--ease), transform .5s var(--ease);
}
.nav-sheet__preview.is-on { opacity: 1; transform: none; }
.nav-sheet__preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.nav-sheet__list a {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 1.25rem;
  align-items: baseline;
  padding: clamp(.7rem, 1.6vh, 1.1rem) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--fg-1);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), color .25s;
}
.nav-sheet.is-open .nav-sheet__list a { opacity: 1; transform: none; }

.nav-sheet__num,
.nav-sheet__meta {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.nav-sheet__name {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.9vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  transition: color .25s;
}
.nav-sheet__list a:hover .nav-sheet__name,
.nav-sheet__list a:hover .nav-sheet__num { color: var(--row-accent, var(--fg)); }

@media (max-width: 1024px) {
  .nav-sheet__inner { grid-template-columns: minmax(0, 1fr); max-width: 52rem; }
  .nav-sheet__preview { display: none; }
}

@media (max-width: 700px) {
  .nav-index { padding-left: .75rem; gap: .5rem; }
  .nav-index__label { font-size: .625rem; }
  .nav-sheet__list a { grid-template-columns: 2rem 1fr; }
  .nav-sheet__meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-index, .nav-sheet, .nav-sheet__list a { transition: none; }
}
