/* ─────────────────────────────────────────────────────────────
   The way around: the floating pill in smoked glass, and the
   side word as an index.
   ───────────────────────────────────────────────────────────── */

/* a word that rolls up to its own copy under the hand */
.roll { display: inline-block; overflow: hidden; vertical-align: top; height: calc(14 * var(--u)); }
.roll__in { display: block; }
.roll i { display: block; transition: transform .55s var(--ease-out); }
a:hover > .roll i, .is-done > .roll i { transform: translateY(-100%); }

/* ── the pill: dark glass, a white light under the hand ─────── */
.nav { position: fixed; left: 50%; top: calc(16 * var(--u)); z-index: 8; display: flex; align-items: center; gap: calc(4 * var(--u)); padding: calc(5 * var(--u)); border-radius: 999px; visibility: hidden; white-space: nowrap; isolation: isolate; color: #f4f4f2; background: rgba(14, 14, 14, .62); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 14px 40px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .1); }
.nav::before { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: radial-gradient(calc(140 * var(--u)) circle at var(--mx, 50%) 50%, rgba(255, 255, 255, .16), transparent 70%); opacity: 0; transition: opacity .4s; }
.nav:hover::before { opacity: 1; }
/* the name opens the pill, set apart from the parts by a hairline */
.nav__brand { position: relative; display: inline-flex; align-items: flex-start; gap: calc(3 * var(--u)); padding: calc(9 * var(--u)) calc(16 * var(--u)) calc(10 * var(--u)) calc(14 * var(--u)); margin-right: calc(4 * var(--u)); font-weight: 500; }
.nav__brand sup { font-size: calc(8 * var(--u)); line-height: calc(9 * var(--u)); font-weight: 400; opacity: .5; }
.nav__brand::after { content: ''; position: absolute; right: calc(-4 * var(--u)); top: 25%; bottom: 25%; width: 1px; background: rgba(255, 255, 255, .16); }
.nav__group { position: relative; display: flex; align-items: center; }
.nav__hl { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; pointer-events: none; opacity: 0; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.nav__item { position: relative; display: inline-flex; align-items: flex-start; gap: calc(3 * var(--u)); padding: calc(9 * var(--u)) calc(16 * var(--u)) calc(10 * var(--u)); }
.nav__item sup { font-size: calc(8 * var(--u)); line-height: calc(9 * var(--u)); opacity: .5; }
.nav__cta { display: inline-flex; padding: calc(9 * var(--u)) calc(16 * var(--u)) calc(10 * var(--u)); border-radius: 999px; background: #f4f4f2; color: #0d0d0c; transition: transform .45s var(--ease-out); }
.nav__cta:hover { transform: scale(1.03); }
/* a small chevron: down beside the work, right on each category */
.nav__chev { align-self: center; width: calc(5 * var(--u)); height: calc(5 * var(--u)); margin-left: calc(4 * var(--u)); border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-25%) rotate(45deg); opacity: .6; transition: transform .35s var(--ease-out); }
.nav__item[aria-expanded="true"] .nav__chev { transform: translateY(25%) rotate(-135deg); }
.nav__chev--r { transform: rotate(-45deg); margin-left: auto; }

/* the categories, in a panel of the same glass */
.nav__drop { position: fixed; z-index: 8; min-width: calc(260 * var(--u)); padding: calc(6 * var(--u)); border-radius: calc(18 * var(--u)); color: #f4f4f2; background: rgba(14, 14, 14, .62); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 14px 40px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .1); visibility: hidden; opacity: 0; pointer-events: none; }
.nav__drop.is-open { pointer-events: auto; }
[data-theme="dark"] .nav__drop { background: rgba(44, 44, 42, .55); border-color: rgba(255, 255, 255, .16); }
.nav__opt { display: flex; align-items: center; gap: calc(16 * var(--u)); padding: calc(11 * var(--u)) calc(14 * var(--u)) calc(12 * var(--u)); border-radius: calc(12 * var(--u)); transition: background-color .25s; }
.nav__opt + .nav__opt { margin-top: calc(2 * var(--u)); }
.nav__opt:hover, .nav__opt:focus-visible { background: rgba(255, 255, 255, .1); }
.nav__opt:focus-visible { outline: 1px solid rgba(255, 255, 255, .6); outline-offset: -1px; }
.nav__opt:hover .nav__chev--r { opacity: 1; }
.nav__opt span { display: inline-flex; align-items: flex-start; gap: calc(3 * var(--u)); white-space: nowrap; }
.nav__opt sup { font-size: calc(8 * var(--u)); line-height: calc(9 * var(--u)); opacity: .5; }

/* by night the glass lifts a little off the page */
[data-theme="dark"] .nav { background: rgba(44, 44, 42, .55); border-color: rgba(255, 255, 255, .16); }

/* light or dark: a disc, half filled, that turns over */
.nav__theme { display: grid; place-items: center; width: calc(33 * var(--u)); height: calc(33 * var(--u)); padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; transition: background-color .3s; }
.nav__theme:hover { background: rgba(255, 255, 255, .1); }
.nav__theme i { width: calc(13 * var(--u)); height: calc(13 * var(--u)); border: 1px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); transition: transform .7s var(--ease-io); }
[data-theme="dark"] .nav__theme i { transform: rotate(180deg); }

/* ── the side as an index ───────────────────────────────────── */
.side__cell { position: absolute; display: block; background: var(--ink); opacity: 0; pointer-events: none; }
.side .word i { transition: background-color .35s; }
.side.is-index .word i.is-inv { background: var(--ground); }
.side__tip { position: absolute; left: calc(100% + 10 * var(--u)); top: 0; margin-top: calc(-12 * var(--u)); padding: calc(4 * var(--u)) calc(10 * var(--u)) calc(5 * var(--u)); background: var(--ink); color: var(--bg); border-radius: 999px; white-space: nowrap; pointer-events: none; visibility: hidden; }

/* ── small screens: the pill floats at the foot ── */
@media (max-width: 1100px) {
  .roll { height: 16px; }
  .nav { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); padding: 4px; gap: 2px; font-size: 13px; line-height: 16px; }
  .nav__brand { display: none; }
  .nav__item { padding: 8px 12px 9px; }
  .nav__item--methode { display: none; }
  .nav__item sup { font-size: 9px; line-height: 10px; }
  .nav__cta { padding: 8px 14px 9px; }
  .nav__theme { width: 32px; height: 32px; }
  .nav__theme i { width: 13px; height: 13px; }
  .nav__chev { width: 5px; height: 5px; margin-left: 4px; }
  .nav__drop { left: 16px !important; right: 16px; min-width: 0; max-width: 360px; max-height: 60vh; overflow-y: auto; padding: 4px; border-radius: 16px; font-size: 13px; line-height: 16px; }
  .nav__opt { padding: 11px 12px 12px; border-radius: 12px; }
  .nav__opt sup { font-size: 9px; line-height: 10px; }
  .side__cell, .side__tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .roll i, .nav__theme i { transition: none; }
}
