/* ─────────────────────────────────────────────────────────────────────────────
   Liquid Glass — shared design tokens + interactive nav components.
   Used by index, about, archive, contact, series-01.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --lg-fill:           rgba(255,255,255,0.08);
  --lg-fill-hover:     rgba(255,255,255,0.16);
  --lg-fill-active:    rgba(255,255,255,0.22);
  --lg-stroke:         rgba(255,255,255,0.18);
  --lg-stroke-hover:   rgba(255,255,255,0.32);
  --lg-highlight:      rgba(255,255,255,0.45);
  --lg-shadow:         0 10px 30px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.28);
  --lg-shadow-hover:   0 16px 40px rgba(0,0,0,0.42), 0 3px 8px rgba(0,0,0,0.32);
  --lg-spring:         cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Hamburger button (mobile only — `display: flex` lives in each page) ── */
.nav-hamburger {
  display: none;
  position: relative; z-index: 1;
  width: 44px; height: 44px;
  cursor: pointer; padding: 0;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  border-radius: 50%;
  background: var(--lg-fill);
  border: 1px solid var(--lg-stroke);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--lg-highlight),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    var(--lg-shadow);
  transition: background 0.3s ease, border-color 0.3s ease,
              transform 0.4s var(--lg-spring), box-shadow 0.3s ease;
  overflow: hidden;
  isolation: isolate;
}
.nav-hamburger::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%);
}
.nav-hamburger:hover {
  background: var(--lg-fill-hover);
  border-color: var(--lg-stroke-hover);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    var(--lg-shadow-hover);
}
.nav-hamburger:active {
  transform: translateY(0) scale(0.94);
  background: var(--lg-fill-active);
  transition-duration: 0.12s;
}
.nav-hamburger span {
  display: block; width: 18px; height: 1px;
  background: rgba(240,237,232,0.95);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* ── Full-screen menu overlay ── */
.nav-menu {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(8,8,8,0.97);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2.4rem;
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.nav-menu.open { opacity: 1; pointer-events: all; }
.nav-menu a {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  font-weight: 300; font-style: italic;
  color: rgba(240,237,232,0.55);
  transition: color 0.2s;
}
.nav-menu a {
  --lg-warp-tx:  0px;
  --lg-warp-ty:  0px;
  --lg-warp-skx: 0deg;
  --lg-warp-sky: 0deg;
  --lg-warp-rot: 0deg;
  position: relative;
  z-index: 1;
  padding: 0.4rem 1.4rem;
  transform-origin: center;
  transition: color 0.25s ease,
              transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.nav-menu a:hover { color: #fff; }
.nav-menu a.active { color: rgba(240,237,232,0.9); }
.nav-menu a.is-pressing {
  color: #fff;
  transform:
    translate(var(--lg-warp-tx), var(--lg-warp-ty))
    scale(1.10)
    skew(var(--lg-warp-skx), var(--lg-warp-sky))
    rotate(var(--lg-warp-rot));
}

/* Touch-press warp for all primary interactive elements.
   Initialized by initButtonPressWarp() — only fires on touch pointers (not mouse). */
.hero-cta,
.stage-email,
.back-link,
.series-row,
.work,
.nav-hamburger,
.nav-menu-close,
.lightbox-close {
  --lg-warp-tx:  0px;
  --lg-warp-ty:  0px;
  --lg-warp-skx: 0deg;
  --lg-warp-sky: 0deg;
  --lg-warp-rot: 0deg;
}
.hero-cta.is-pressing,
.stage-email.is-pressing,
.back-link.is-pressing,
.series-row.is-pressing {
  transform:
    translate(var(--lg-warp-tx), var(--lg-warp-ty))
    scale(1.06)
    skew(var(--lg-warp-skx), var(--lg-warp-sky))
    rotate(var(--lg-warp-rot));
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.work.is-pressing {
  transform:
    translate(var(--lg-warp-tx), var(--lg-warp-ty))
    scale(1.035)
    skew(var(--lg-warp-skx), var(--lg-warp-sky))
    rotate(var(--lg-warp-rot));
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Round icon buttons. The button-tag prefix lifts specificity above the
   per-page inline `:active` rule for .lightbox-close. */
button.nav-hamburger.is-pressing {
  transform:
    translate(var(--lg-warp-tx), var(--lg-warp-ty))
    scale(1.06)
    skew(var(--lg-warp-skx), var(--lg-warp-sky))
    rotate(var(--lg-warp-rot));
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
button.nav-menu-close.is-pressing,
button.lightbox-close.is-pressing {
  /* Close buttons get an extra 90° base rotation — matches their existing hover rotate */
  transform:
    translate(var(--lg-warp-tx), var(--lg-warp-ty))
    scale(1.06)
    skew(var(--lg-warp-skx), var(--lg-warp-sky))
    rotate(calc(var(--lg-warp-rot) + 90deg));
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Mobile menu slide pill — bubble that travels from the first item to the tapped target. */
.nav-menu-pill {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.24);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 14px 36px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.25s ease;
  overflow: hidden;
}
.nav-menu-pill::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 55%);
}
.nav-menu-pill.active { opacity: 1; }

.nav-menu-close {
  position: absolute; top: 1.4rem; right: 1.6rem;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(240,237,232,0.85);
  font-size: 1.3rem; line-height: 1;
  cursor: pointer; padding: 0;
  border-radius: 50%;
  background: var(--lg-fill);
  border: 1px solid var(--lg-stroke);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--lg-highlight),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    var(--lg-shadow);
  transition: color 0.2s ease, background 0.3s ease, border-color 0.3s ease,
              transform 0.4s var(--lg-spring), box-shadow 0.3s ease;
  overflow: hidden;
  isolation: isolate;
}
.nav-menu-close::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%);
}
.nav-menu-close:hover {
  color: #fff;
  background: var(--lg-fill-hover);
  border-color: var(--lg-stroke-hover);
  transform: translateY(-1px) rotate(90deg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    var(--lg-shadow-hover);
}
.nav-menu-close:active {
  transform: scale(0.94);
  background: var(--lg-fill-active);
  transition-duration: 0.12s;
}

/* ── Nav link pills — cursor-tracked specular + 3D warp + magnetic pull ── */
.nav-links {
  position: relative;
  display: flex;
  gap: 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240,237,232,0.55);
}

.nav-links a {
  --mx: 50%; --my: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  color: rgba(240,237,232,0.55);
  background: transparent;
  border: 1px solid transparent;
  transform-style: preserve-3d;
  transition: color 0.35s ease, background 0.45s ease, border-color 0.45s ease,
              transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.45s ease;
  overflow: hidden;
  isolation: isolate;
  will-change: transform;
  z-index: 1;
}
.nav-links a.is-tracking {
  transition: color 0.35s ease, background 0.45s ease, border-color 0.45s ease,
              transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}
.nav-links a::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 90% at var(--mx) var(--my),
    rgba(255,255,255,0.32) 0%, rgba(255,255,255,0.10) 38%, rgba(255,255,255,0) 72%);
  opacity: 0; transition: opacity 0.4s ease;
}
.nav-links a::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%);
  opacity: 0; transition: opacity 0.4s ease;
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::before,
.nav-links a:hover::after { opacity: 1; }
.nav-links a.active { color: rgba(240,237,232,0.95); }

/* ── Sliding glass indicator pill — stretches across old + new positions for the "merge" ── */
.nav-pill {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.16),
    0 10px 28px rgba(0,0,0,0.32);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}
.nav-pill::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%);
}
.nav-pill.active { opacity: 1; }
